You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File.open('/tmp/some-file','wb')do |file|
body=nilskip_json=truesite.query:get,'https://my.site.com/some/site/some/path/to/file.pdf',body,skip_jsondo |curl|
curl.headers["Accept"]='application/octet-stream'curl.headers["Content-Type"]='application/json;odata=verbose'curl.on_bodydo |data|
file.writedata# or whatever else you want to do with the data.data.length# curl.on_body block must return the data lengthendendend
folder=site.folder'/SiteAssets/documents'# Get a folder by server relative pathfile=folder.file_from_name('some-file-name.pdf')file.download# or file.download_to_file(some_file)
I can see that there is a way you can upload files via a stream but is there a way to download a file via stream to try and speed up the process.
The text was updated successfully, but these errors were encountered: