0
votes

I'm writing an application that can upload image files and video files, and allow the user to upload from their 'Pictures' folder or a USB stick. Currently it can do everything except upload a video file from a USB stick. Images from the 'Pictures' folder are fine, images from a USB stick are fine, videos from the 'Pictures' folder are fine, but videos from a USB stick are not fine.

There really isn't much code to this:

private async Task SearchFoldersForMedia(StorageFolder folderToSearch)
{
    IReadOnlyList<StorageFile> allFilesInFolder = await folderToSearch.GetFilesAsync();

    // other code here...
}

It's pretty bare-bones, honestly. If my 'Pictures' folder has 3 videos (.mp4) then that one line will find three video files, but if my datastick has 3 videos then that same line will find nothing. If I look in either my datastick or my 'Pictures' folder for image files (.jpg, .jpeg, or .png) then they all get found as they should be.

What's causing this?

1

1 Answers

1
votes

The issue was in my Package.appxmanifest, not the code I had written. Solution found by following the advice used here: Correct mime type for .mp4

Incidentally, this means I was never really uploading the videos from my 'Pictures' folder, even though they seemed to get uploaded. I suspect the external drive wasn't even showing them as present was due to an increased protection level when dealing with external devices.