Home arrow static arrow Java Programming [Archive] - uploading files using HttpUrlConnection
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - uploading files using HttpUrlConnection
This topic has 1 reply on 1 page.

Posts:65
Registered: 6/21/04
uploading files using HttpUrlConnection  
Aug 8, 2004 12:51 PM



 
I am trying to upload a file to a CGI using HttpUrlConnection. The examples which I have seen simply write the file contents to the output stream of the connection. However, this does not appear to be working for me as when I get the response I simply get the html code of the website back. Moreover, I also get heap space errors when I try to Post a big file. Does anyone have any ideas as to what I am **** wrong? I am trying to communicate with the following URL:

http://www.ncbi.nlm.nih.gov/entrez/batchentrez.cgi

Thanks
 

Posts:3,183
Registered: 10.09.03
Re: uploading files using HttpUrlConnection  
Aug 9, 2004 12:00 AM (reply 1 of 1)



 
HTTP wasn't designed to upload large files, that's what FTP was invented for. requests are limited in size on the webserver (standard value I see most of the time is 10mb max), so you can't upload files which are larger than that.

The fact that you are getting the HTML output is correct, you would get the same output as if you were uploading the file through a webpage. What response were you expecting?
 
This topic has 1 reply on 1 page.