Uploading file using Web API and Azure server - asp.net-web-api

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.

Related

Strapi endpoint for all media uploads

Does anyone know the endpoint for getting all of the iamges you uploaded to the media libray in one request?
Im using next js with strapi and need a way to grab all of the images from the media library but there doesnt seem to be any documentation on this
/api/upload
GET /api/upload/files Get a list of files
GET /api/upload/files/:id Get a specific file
POST /api/upload Upload files
DELETE /api/upload/files/:id Delete a file
Reference
https://docs.strapi.io/developer-docs/latest/plugins/upload.html#configuration
GET /upload/files
You can read more on the docs

Download blob url

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.

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"

Parse Server - Uploading files using AppId vs FileKey for directory name

This question is in regarding to Parse Server deployment done on Heroku/Localhost Vs. Parse.com behavior:
If I upload files to Parse.com I get a URL as:
http://files.parsetfss.com/<fileKey>/<unique-id>-<provided-filename>
But, when I use the deployment on Heroku or Localhost, I get a URL as:
http://localhost:1337/<appId>/<unique-id>-<provided-filename>
I have provided a fileKey in my index.js of my parse server, yet it doesn't use it when creating the URL but instead uses the AppId for the directory in the URL.
Is there a setting so I can hide the appId and simply use the fileKey?
Thank you.

How to separate the files from Google Drive in the Response only using Rest API

Hi I'M new to windows phone Application development i'm working on how to get access the files from google drive using rest api i got the response in the response i got all the information like .pdf,.docs,mp3,mp4 ,folders etc...and the response is coming slow from the web for that is there any solution that.I should get response only that contains images and folders so that app will fast and accuracy... Thanks in Advance.
https://www.googleapis.com/drive/v2/files?q=mimeType contains 'image/jpeg'
The above link is for getting only images in this way according to mime type we can get the files rather than getting all files at a time

Resources