I CAN NO LONGER UPLOAD FILES THROUGH DEVICE PORTAL

It is really a strange thing that only recently I can no longer upload files (csv, img, or any) through device portal to any deployed applications. I tried it on all my three HoloLens, and I tried it with all kinds of browser possible, and I do believe I configured everything to be accessible like developer mode, no firewall, etc.

But it ends up with the error when I click Upload button every time: "Failed to upload file. Error:[object Object]"

Tagged:

Answers

  • Same here.

  • same here

  • same same

  • stepan_stulovstepan_stulov ✭✭✭
    edited May 2018

    Hey, guys.

    Fix:

    1. Select the file you wish to upload but do not click the upload button.
    2. Copy-paste the following javascript code into your browser's console.
    3. Wait for the "uploaded" popup.

    javascript:(function(jQuery){var pathLinkData=jQuery('.pathLink:last-child').data(),path=pathLinkData.path,packagename=pathLinkData.packagename,knownfolderid=pathLinkData.knownfolderid,url='/api/filesystem/apps/file?knownfolderid='+knownfolderid+'&packagefullname='+packagename+'&path=%5C%5C'+path,file_data=jQuery('#fileToUpload')[0].files[0],form_data=new FormData();form_data.append('file',file_data,file_data.name);jQuery.ajax({url:url,dataType:'text',cache:false,contentType:false,processData:false,data:form_data,type:'POST',error:function(xhr,textStatus,error){console.error(error)},success:function(res){alert("uploaded");console.log(res);}});})(jQuery);

    I think Device Portal has a bug with missing/incorrect header.

    Cheers

    PS: I am not the author of the code snippet. Unfortunately I cannot find the author anymore but he/she saved my ass a good thousand times by now.

    Building the future of holographic navigation. We're hiring.

Sign In or Register to comment.