In my app, it is possible to download a file from the internet.
So, for example I’d pass http://ardownload.adobe.com/pub/adobe/reader/win/9.x/9.0/enu/AdbeRdr90_en_US.exe to my function and it downloads the file from the URL to my computer.
I would like to be able to show the download progress, but this seams no possible to do because the InputStream created by the URL class shows me -1 as length (length unknown).
i used libcurl for some time now and it works great, supports all the protocols out of the box, you just add the files to your project (no lib dlls or other stuff) build everywhere and is very well documented.
i was kinda hoping jules would consider using curl for his URL class, it would gain a lot more functionality.
Mmm… but should you do it, beware of platform issues as curl uses fopen to verify a file (doing multipart posts) and fopen doesn’t support UTF8 on windows. So on windows, the stream callback must be used (libcurl 1.18.1). On Mac I never got the stream callback to work, so on Mac I use libcurls own file upload…
As JUCE now supports multipart posts (right Jules :?: ) , I suppose you don’t need anything else. We’re thinking of going back to juce::URL for that reason (and for avoiding different code on different platforms).
Yes, I did a project recently that required file uploading, so I sorted that stuff out. If you do hit any probs with it, please let me know as I’ll need to fix it!
I need to upload a file to a server. The server side cgi expects a parameter userId and the file name. I try the following code, but it’s not even able to see userId on the other end (the script doesn’t go on to see if the file has been posted yet but I am sure that wouldn’t work either. This is my first attempt at using juce for file upload and I think I’m missing something simple:
I’m using libcurl as well for internet uploads/downloads. Besides giving a callback function to get the info for a progress bar, libcurl also supports http authentication, including digest, and HTTPS. The lack of support for authentication in Juce’s URL class is what led me to consider libcurl.
I posted because I hope I’m wrong and that there really is support for authentication in Juce.