Page 1 of 1
Download a file with long path - from internet.
Posted: Tue Jan 06, 2026 12:10 am
by matalog
I just want to download a file at a time - the path is something like
Code: Select all
https://d1zfca9r0ctlm4.changedtext.net/21153/22682/54704/20100401/images/8/page-005.jpg?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kMXpmY2E5cjBjdGxtNC5jbG91ZGZyb250Lm5ldC8yMTE1My8yMjY4Mi81NDcwNC8yMDEwMDQwMS9pbWFnZXMvPy9wYWdlLT8~Pz8~Py5qcGciLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE3Njc2NTc2NjB9LCJEYXRlR3JlYXRlclRoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTc2NzU3MTIwMH0sIklwQWRkcmVzcyI6eyJBV1M6U291cmNlSXAiOiIwLjAuMC4wLzAifX19XX0_&Signature=q7lTipmA8qtLcEtUoI2l5nCch5JdcGRPK-z8EcXnL03eE~J-cD4fO~crpiShn4KjADVkF97LZXKYyIJ~AUqOu9e2CvawxaaURsQCUH~PBCC-oD7IXlo4s58dCci2dD~RwGMNNI6HnbWm1o14J7nqvlDWyVlzwD251DJfpZDI8ck_&Key-Pair-Id=APKAILCKZYUYWFSF3MGH
Wget reports path too long, tries to shorten it and it fails to download obviously.
How could I do this. I have read about libcurl and chilkat but there doesn't seem to be a simple https single file download example.
Any tips for doing this?
Re: Download a file with long path - from internet.
Posted: Tue Jan 06, 2026 8:40 am
by BarryG
Does it work if you remove everything after ".jpg" ?
Re: Download a file with long path - from internet.
Posted: Tue Jan 06, 2026 9:17 am
by infratec
You can download files with curl, you need only to specify the output filename:
http://www.compciv.org/recipes/cli/down ... with-curl/
Re: Download a file with long path - from internet.
Posted: Tue Jan 06, 2026 10:00 am
by ChrisR
You can also use
aria2 - The ultra fast download utility
I use it for large files (windows iso) with the parallel fragment download
Code: Select all
aria2c --log-level=notice --log="E:\Temp\Aria2c_Download.log" -x16 -s16 --allow-overwrite=true --auto-file-renaming=false -d"E:\temp" -o"page-005.jpg" "https://d1zfca9r0ctlm4.changedtext.net/21153/22682/54704/20100401/images/8/page-005.jpg....."
;or with default options (without -d default dir is aria2c path)
aria2c -dE:\temp "https://d1zfca9r0ctlm4.changedtext.net/21153/22682/54704/20100401/images/8/page-005.jpg....."
ErrorCode=19: Name resolution for d1zfca9r0ctlm4.changedtext.net failed:Domain name not found
Re: Download a file with long path - from internet.
Posted: Tue Jan 06, 2026 11:41 am
by matalog
BarryG wrote: Tue Jan 06, 2026 8:40 am
Does it work if you remove everything after ".jpg" ?
No, it needs the rest.
Re: Download a file with long path - from internet.
Posted: Tue Jan 06, 2026 11:43 am
by matalog
ChrisR wrote: Tue Jan 06, 2026 10:00 am
You can also use
aria2 - The ultra fast download utility
I use it for large files (windows iso) with the parallel fragment download
Code: Select all
aria2c --log-level=notice --log="E:\Temp\Aria2c_Download.log" -x16 -s16 --allow-overwrite=true --auto-file-renaming=false -d"E:\temp" -o"page-005.jpg" "https://d1zfca9r0ctlm4.changedtext.net/21153/22682/54704/20100401/images/8/page-005.jpg....."
;or with default options (without -d default dir is aria2c path)
aria2c -dE:\temp "https://d1zfca9r0ctlm4.changedtext.net/21153/22682/54704/20100401/images/8/page-005.jpg....."
ErrorCode=19: Name resolution for d1zfca9r0ctlm4.changedtext.net failed:Domain name not found
Thanks, I used aria2c from PB, it works well. I just had to pad the RunProgram() strings with Chr(34)'s to get the required Quotation marks within a string.
Re: Download a file with long path - from internet.
Posted: Tue Jan 06, 2026 11:43 am
by matalog
Thanks for that infratec.
Re: Download a file with long path - from internet.
Posted: Tue Jan 06, 2026 12:21 pm
by BarryG
matalog wrote: Tue Jan 06, 2026 11:43 amThanks for that infratec.
Yes, thanks! Topic bookmarked in case I ever need it in future.

Re: Download a file with long path - from internet.
Posted: Tue Jan 06, 2026 2:13 pm
by NicTheQuick
wget has a lot of possible arguments. With `wget -o <outputfile> <URL>` you can download anything to a file name of your choice.
Re: Download a file with long path - from internet.
Posted: Tue Jan 06, 2026 11:08 pm
by matalog
NicTheQuick wrote: Tue Jan 06, 2026 2:13 pm
wget has a lot of possible arguments. With `wget -o <outputfile> <URL>` you can download anything to a file name of your choice.
I have already achieved what I need to do, but I'm curious. Are you suggesting that wget
can be used to download a file with a path longer than 300 characters?
Re: Download a file with long path - from internet.
Posted: Wed Jan 07, 2026 10:51 am
by NicTheQuick
matalog wrote: Tue Jan 06, 2026 11:08 pm
NicTheQuick wrote: Tue Jan 06, 2026 2:13 pm
wget has a lot of possible arguments. With `wget -o <outputfile> <URL>` you can download anything to a file name of your choice.
I have already achieved what I need to do, but I'm curious. Are you suggesting that wget
can be used to download a file with a path longer than 300 characters?
It depends on the file system of course. NTFS has a max path length of 32,767 unicode characters but Windows has an internal constant MAX_PATH set to 260 characters which prevents you from creating long path names in most cases.
Re: Download a file with long path - from internet.
Posted: Wed Jan 07, 2026 12:44 pm
by BarryG
NicTheQuick wrote: Wed Jan 07, 2026 10:51 amWindows has an internal constant MAX_PATH set to 260 characters which prevents you from creating long path names in most cases.
You can prefix the path with "\\?\" on Windows to allow paths of 32767 characters, and/or set a Registry key to allow it.
See here:
https://learn.microsoft.com/en-us/windo ... limitation
Re: Download a file with long path - from internet.
Posted: Thu Jan 08, 2026 11:40 am
by matalog
NicTheQuick wrote: Wed Jan 07, 2026 10:51 am
matalog wrote: Tue Jan 06, 2026 11:08 pm
NicTheQuick wrote: Tue Jan 06, 2026 2:13 pm
wget has a lot of possible arguments. With `wget -o <outputfile> <URL>` you can download anything to a file name of your choice.
I have already achieved what I need to do, but I'm curious. Are you suggesting that wget
can be used to download a file with a path longer than 300 characters?
It depends on the file system of course. NTFS has a max path length of 32,767 unicode characters but Windows has an internal constant MAX_PATH set to 260 characters which prevents you from creating long path names in most cases.
I'm not sure I know what you mean. Wget told me that the path was too long and it truncated it, aria2c didn't give me the same warning and worked perfectly with the same path. These programs were both running on the same operating system on the same computer.
This leads me to think that it isn't the way that my Windows is set up, it is something with wget.
Re: Download a file with long path - from internet.
Posted: Thu Jan 08, 2026 12:00 pm
by NicTheQuick
matalog wrote: Thu Jan 08, 2026 11:40 am
I'm not sure I know what you mean. Wget told me that the path was too long and it truncated it, aria2c didn't give me the same warning and worked perfectly with the same path. These programs were both running on the same operating system on the same computer.
This leads me to think that it isn't the way that my Windows is set up, it is something with wget.
Well, you never posted how you used wget. I never used it on Windows. I am on Linux only. And I never had issues with downloading files with wget. And I only use it in den CLI or in a shell script.