Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload errors on Windows build 203xxx #310

Open
david-c-kline opened this issue Jun 15, 2021 · 4 comments
Open

Upload errors on Windows build 203xxx #310

david-c-kline opened this issue Jun 15, 2021 · 4 comments

Comments

@david-c-kline
Copy link

From Tadashi Tsuyuki via slack:

Hello,
Recently, we got report of errors uploading a file to the HoloLens2 app's LocalState folder.
Our software uses the Windows Device Portal API to upload files.
When I tried it with the emulator, I got an error with versions 10.0.20348.1007 and 10.0.20346.1002.
10.0.19041.1154 and 10.0.19041.1136 work fine.
Is there a solution? Thanks.
Exception information
RequestUri {http://XXX.XXX.XXX.XXX/api/filesystem/apps/file?knownfolderid=LocalAppData&path=/LocalState&packagefullname=XXXXX_1.0.0.0_x86__pzq3xp76mxafg}
Reason Missing extraction flag from http request
Source WindowsDevicePortalWrapper
StatusCode System.Net.HttpStatusCode.BadRequest
Stack Trace
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Tools.WindowsDevicePortal.DevicePortal.d__47.MoveNext()

@vwidor
Copy link

vwidor commented Jul 7, 2021

Same issue here (for all folders on the HoloLens2 and only uploading files - installing apps, etc. works fine).
Uploading files using Chrome, Firefox, ... (by Windows Device Portal) also fails (using Edge will still work to upload files)
Only solution for now is to downgrade/ hold the HoloLens2 to/ at 10.0.19041.1154.
Hope there will be a fix on the HoloLens2 (or a lot of clients?) soon.

@pbarnettms
Copy link

pbarnettms commented Jul 7, 2021

Uploading files via browsers was a known issue. Please follow the workaround documented at https://docs.microsoft.com/en-us/hololens/hololens-troubleshooting#device-portal-file-uploaddownload-times-out until you receive the next HoloLens OS update (10.0.19041.1157 or newer, or 10.0.2048.1010 or newer).

@DesperateHouseDev
Copy link

Hello,

We're having the very same issue with versions 2004, 20H2 and 21H1. @pbarnettms 's proposed workaround above works fine for fixing the file explorer feature (including file upload/download) in the Devive Portal Web Interface, but, when trying to use the Device Portal API in a c# program to upload files, we are still getting that obscure
BadRequest Reason Missing extraction flag from http request response...

Code extract :

public void UploadRequest(string fileFullPath,string appSubDirectoryName)
{
            
                RestRequest request = new RestRequest("/api/filesystem/apps/file");
                request.Parameters.Add(new Parameter("knownfolderid", "LocalAppData", ParameterType.QueryString));
                request.Parameters.Add(new Parameter("packagefullname", packageFullName, ParameterType.QueryString));
                request.Parameters.Add(new Parameter("path", "\\LocalState\\" + appSubDirectoryName + "\\", ParameterType.QueryString));
                request.AlwaysMultipartFormData = true;
                request.Timeout = 100 * 1000;
                request.AddHeader("Accept-Encoding", "gzip,deflate");
                request.AddFile("file", fileFullPath);
                request.AddHeader("X-CSRF-Token", csrfToken);
                request.Method = Method.POST;
                var response = client.Post(request);
                Debug.WriteLine("Device Portal response : " + response.StatusCode + " | " + response.Content); // Displays BadRequest | "Reason" : "Missing extraction flag from http request"
            
}

This used to work fine before Windows Holographic version 2004 .
Are we missing something here ? Some kind of new header that shall be included in http requests ?

@pbarnettms
Copy link

The error is saying that your request is missing the "extract" querystring parameter. It must be present and set to "true" or "false". Set it to "true" if the file is a .zip file that you want extracted after upload.

develmusa pushed a commit to develmusa/WindowsDevicePortalWrapper that referenced this issue Sep 16, 2021
Add the required `extract` parameter to enable file upload on Windows Holographic version 2004 and heigher.

see: microsoft#310
develmusa pushed a commit to develmusa/WindowsDevicePortalWrapper that referenced this issue Sep 16, 2021
Add the required `extract` parameter to enable file upload on Windows Holographic version 2004 and higher.

see: microsoft#310
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants