I'm uploading lot of files to OneDrive using Graph API. Sometimes I receive DriveItem with size of 0. Response always return 20x status code. When I check file on OneDrive, file size is not displayed at all.
I'm using request for small size files https://learn.microsoft.com/en-us/graph/api/resources/driveitem?view=graph-rest-1.0
Related
I want to track the change of some drives when files have been uploaded and shared, as described here: https://learn.microsoft.com/en-us/graph/api/driveitem-delta?view=graph-rest-1.0 & tabs = http I am using the delta request.
After some changes occur and I run the delta query, it returns the drive item of the file that the change occurs.
If I shared the file with other users, the response does not show me who shared the file, I can only find the "createdBy" which is the user who uploads the file to the drive.
My question is if it is possible to find out who shared the file?
I followed this document for handling multipart form data
I can upload ok with file size below 2GB. With the size is greater than 2GB, the application sends nothing.
Does anyone have experience in uploading large files using fsharp.data?
I'm trying to update my profile picture using Microsoft Graph Explorer (v1.0) but I'm unable to do it, I'm always getting the following error :
An internal server error occurred. The operation failed., The file you chose isn't an image. Please choose a different file.
The problem is that the file I'm trying to update my picture with is an image inserted in the request body (a base64 representation of it, I used this site in order to get it: https://www.base64-image.de/).
I'm also using the header Content-Type with the value image/jpeg and I think that, as I'm logged, I don't need the authorization header.
The URL I'm using is: https://graph.microsoft.com/v1.0/me/photo/$value
This endpoint takes the raw image as input, not a base64 encoded version. From the documentation:
Request body
In the request body, include the binary data of the photo in the request body.
Since it isn't possible to stream a file like this using Graph Explorer, updating the photo isn't supported by Graph Explorer.
I'm developing a download manager using Indy and Delphi XE (The application uses Multithreading to attempt several connections to the server). Everything works fine but sometimes the final downloaded file is broken and when I check downloaded temp files I see that 2 or 3 of them is filled with zero at their end. (Each temp file is download result of each connection).
The larger the file is, the more broken temp files I get as the result.
For example in one of the temp files which was 65,536,000 bytes, only the range of 0-34,359,426 was valid and from 34,359,427 to 64,535,999 it was full of zeros. If I delete those zeros, application will automatically download the missing segments and what I get as the result, well if the problem wouldn't happen again, is the healthy downloaded file.
I want to get rid of those zeros at the end of the temp files without having a lost in download speed.
P.S. I'm using TFileStream and I'm sending it directly to TIdHTTP and downloading the files using GET method.
Additional Info: I handle OnWork event which assigns AWorkCount to a public int64 variable. Each time the file is downloaded, the downloaded file size (That Int64 variable) is logged to a text file and from what the log says is that the file has been downloaded completely (even those zero bytes).
Make sure the server actually supports downloading byte ranges before you request a range to download. If the server does not support ranges, a requested range will be ignored by the server and the entire file will be sent instead. If you are not already doing so, you should be using TIdHTTP.Head() to text for range support before then calling TIdHTTP.Get(). You also need to do this anyway to detect if the remote file has been altered since the last time you downloaded it. Any decent download manager needs to be able to handle things like that.
Also keep in mind that if TIdHTTP knows up front how many bytes are being transferred, it will pre-allocate the size of the destination TStream before then downloading data into it. This is to speed up the transfer and optimize disc I/O when using a TFileStream. So you should NOT use TFileStream to access the same file as the destination for multiple simultaneous downloads, even if they are writing to different areas of the file. Pre-allocating multiple TFileStream objects will likely trample over each other trying to set the file size to different positions. If you need to download a file in multiple pieces simultaneously then either:
1) download each piece to a separate file and copy them into the final file as needed once you have all of the pieces that you need.
2) use a custom TStream class, or Indy's TIdEventStream class, to manage the file I/O yourself so you can ignore TIdHTTP's pre-allocation attempts and ensure that multiple file I/O operatons do not overlap each other incorrectly.
I have created a application via java-cilent-api to upload and download files in the Google Docs. after Doc up to 5GB,I try to upload a 4GB zip to Google docs and it complete it with no exception;however,the file is not appear in Google docs?? what is the maximum of the upload a file???
The maximum file size in a resumable upload request is 10GiB. For simple requests (not using resumable), the maximum file size is 2MiB.
At the end of the upload request (either resumable or simple), you should get the newly inserted resource's metadata back from the API. The metadata includes an alternate link which points to the web version of the file. Try going to this URL and see if the file exists.