Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Chunked upload in Powershell #14
Great utility, thanks for sharing.
I'm running it inside a Powershell script on Windows Server 2012 R2 to periodically upload backups to dropbox, eg:
It works perfectly for small files, but when larger files require 'chunked' upload it always fails with this error msg:
"File is larger than 150MB, using chunked uploading.
The cmd works as expected in Command Prompt.
Is this a known issue?
Hi Hartez, thanks for getting back to me. This is the basics of the powershell script.. I'm creating a zip file containing a large number of small asset files (mostly jpgs, pngs, pdfs), some of which are nested in sub-dirs. The file name is generated for the current date each time the script runs on a schedule, but I've excluded some of the unrelated details for brevity.
When I run this script in Powershell ISE, it creates the zip and attempts to upload to dropbox (for maybe 2 seconds), then fails with this output:
If I take just the pneumatictube command, and insert the filepath of the successfully created zip, it runs as expected, uploading in approx 04:41 eg:
For now, I've reverted to iterating through my assets dir, and uploading each file individually as they are all well below the 150MB limit. This takes considerably longer.. around 1 hour. It's not a major issue as it runs overnight, but I'd love to be able to use the single zip approach for easier maintenance.
Thanks for your input,
@christopher-abel it appears to be an issue with running in ISE. I can create a script similar to yours which runs fine from the console by fails if I'm running under ISE.
Apparently this is because ISE isn't a real Win32 Console. I'll update the code to try and detect whether the console is available and adjust accordingly.
In the meantime, does your script run correctly if you run it directly from the console (instead of in ISE)?