Download blob url - download

I am working on some chrome extension that detects when a user downloads a file, the extension block the download, sends the download URL to my server, the server downloads the file, scanning the file for virus and if it's ok sends it back to the browser.
all is good except in some cases. when the user downloads a file from his WhatsApp web chat I'm catching the download URL as:
blob:https://web.whatsapp.com/6addcff5-671a-4369-8ead-232099b748c3
but how do I download this blob? I tried to download like a regular link but it gives an error:
using (var client = new WebClient())
client.DownloadFile(theBlobUrl, filePath);
My server is written with C# so prefer a C# answer, but other languages would also be helpful too.

Related

Google Drive API Console: Error saving Drive UI integration page

I have a webapp in production that interacts with Google Drive through Google Drive API.
I need to change some settings in Drive interaction but I can't save.
When I save the Drive UI integration page, I receive this error:
There's a problem at our end.
Please try again. If the problem persists, please let us know using
the "Send feedback" link below. Thanks!
(spying Network console: there is an Internal Server Error in a POST call)
I tried to send feedback for months: nobody answers and the bug is still there.
I tried also to create another project: I can save the first time but then the bug returns.
How can I do? Has someone the same problem?
Is there a way to receive a reply from Google? Is there some workaround?
Thank you.
i think that problem must be Client ID
before adding Client ID, go to the Credentials -> OAuth 2.0 Client IDs
then select edit your Client ID. after that your production site url add to Authorized JavaScript origins and Authorized redirect URIs.
then enter your Client ID in Drive UI integration page
For myself trying to get the Drive UI configured I noticed a couple of errors (that don't have any specific error messages)
When adding in an Open URL it has to be a valid domain, so for instance I tried to test it out with local host, to no avail. However something like https://devbox.app.com worked, but something like https://localhost:8888 does not. Even though https://localhost is a valid javascript origin in the client_id configuration (at least for the app I am working on, not sure about other apps), localhost doesn't work as an open URL.
When adding in the mimeTypes it needs to be in the format */* and can include custom mimeTypes like application/custom+xml and application/custom-name+json not sure for other custom types that are not in a particular format like xml or json. Also not sure about wildcards.
When adding in file extensions do not add in the '.' just the name of the file extension.
The app icon I found only failed to upload the image when the image wasn't the exact dimensions, I actually ended up editing some icons in photoshop to change the pixel x pixel values as a quick work around during dev.
That worked for me to get it to save and I tested it with a file that had a custom mimeType (application/custom-name+xml specifically) and custom file extension!

Google Drive Rest API V3 Downloading large files with alt=media option (>25MB)

I am trying to figure out how I can download a large file directly in the browser via the Google Drive API V3.
I'm using option 1 which is : Download a file — files.get with alt=media file resource
When I send my request ( https://www.googleapis.com/drive/v3/files/[fileId]?alt=media), I got the content of the file as a response of it.
Currently I'm creating a blob file with the response of my query, then reading the blob file to start the download on the browser.
The problem with that is, reading the blob file consumes a lot of memory and if the file's size is more than 10MB, then browser crashes.
So my question is : how can I start the download on browsers via the Google APIs like mention on the screenshot bellow? See expected result
Try downloading the file in chunks using the range http header. See https://developers.google.com/drive/v3/web/manage-downloads "Partial download"

unable do download file from ie11

unable do download file from ie11, when click on download button post request send to the server. I checked in network section the response will come with content of file but in internet explorer 11 download prompt will not appear instead of that if display error page can not display and url will not correct . This program working fine with Mozilla Firefox.
I created a demo program which runs on my local host with same configuration ie11 works fine. but same program I tried to run on my production server tomcat getting same error.
I had this same problem,but incase of PDF's my pdf file was not downloading from IE, in my case also the file was getting downloaded from the Firefox, I just checked the url, there is no such limit to the length of the url but in this I just reduced the length of the url and it worked, but I didn't get what IE does different in this maybe its the server which is handling the request from IE differently or while sending IE is doing something different, just check if this works, reduce the length of the url and try again.

sending PKPAss to Safari with PHP

All,
I am following a tutorial to get PHP to deliver a pass. I have been using the console to check the logs in XCODE. I have also checked and there is no PHP errors on the local server.
When I browse to the page which should download the pass, I get this on my safari screen on my iPhone.
So it is downloading from the local server, but I cannot see the pass, just the binary code.. Is there anything on iPhone 6/ iOS 8 that I should be checking ?
thanks
Your web server is not correctly set up to serve the file with a MIME type that identifies the .pkpass file as a Passbook pass. More so, your server appears to be using a text or html MIME type that instructs the browser to read the file as text.
See my answer to this question for how to properly configure your server.

Uploading file using Web API and Azure server

I'm currently trying to upload image using ASP web API and save it in my Azure server using this tutorial
Then I took the request stream using Request.Content.ReadAsStreamAsync().Result and send it to Azure using blob.UploadFromStream(stream);
The file got uploaded and when I fetch the URL it returns something like
http://testing.cloudapp.net:10000/devstoreaccount1/saveFiles/File_2_2.zip
I tried the link but it just returns a blank page.
Any idea why I can't download my uploaded file back?
It turns out I should just use blob.UploadFile(fullLocalPathFileName) instead of blob.UploadFromStream(stream). You can get the full local path of your file from the MultipartFormDataStreamProvider and just send it easily to the blob.

Resources