PDA

View Full Version : File Uploading using HTTP.Submit


Ninj
03-07-2005, 07:56 PM
I have been trying to submit data to my web server using the HTTP.Submit action as shown in my code below:

local SubmitFName = "";
myValues = { filesfolder="/secure/rp", OpCode=2, filesize=5, logfile="LogFile.txt", nameoffile="D:\\Nina\\Test 021204\\System\\irunin.ini" };
SubmitFName = HTTP.Submit("http://www.myserver.com/cgi-bin/FullCGI.cgi", myValues, SUMBITWEB_GET, 20, 80, nil, nil);

FullCGI.cgi is a script in the server that is supposed to upload a file (in this case, irunin.ini) and write to a log file, LogFile.txt.

After running the Update application and when I check my web server, the file is not uploaded and there's no log in the log file. And there is no error message at all. Server Response is also blank.

I am not sure if this is a bug or maybe I am just missing something here but
submitting this through the IE browser ('http://www.myserver.com/cgi-bin/FullCGI.cgi?filesfolder=/secure/rp&OpCode=2&filesize=5&logfile=LogFile.txt&nameoffile=D:\Nina\Test 021204\System\irunin.ini') is always successful.

Btw, I've already posted this in the beta testing forum but I cannot find the forum now and I still need help with this.

Ted Sullivan
03-09-2005, 09:29 PM
My guess is that your web script needs the file data rather than just the file name. Internet Explorer based HTTP uploads are something much different than a simple HTTP submit using GET. You'd likely need to read the data in to an HTML compatible string and then POST it to your CGI script.

It's certainly possible, but it really depends on what your web server application is looking for and its specific implementation details. The fastest and easiest way to do this might be using an FTP upload though. It's definitely more robust and reliable than an HTTP upload any day.

Ninj
03-10-2005, 12:44 AM
Hi Ted,

Thanks for the reply.

I might sound naive here but could you please explain further the FTP upload. How can I upload through FTP in TU2? I cannot find any action for FTP upload.

I don't mind if I will have to use something else. And I actually prefer FTP. I just don't know how to do this in TU2.

Thanks :)

Ted Sullivan
03-10-2005, 09:00 AM
To perform FTP uploads, you can use the FTP Plugin (http://www.autoplay.org/plugin/ftp.php). All of the Action Plugins that work with AutoPlay Media Studio 5.0 and Setup Factory 7.0, also work with TrueUpdate 2.0.

Here's a link to the Help File (http://www.autoplay.org/help/ftp_plugin.htm). There's also a downloadable demo available from the first link above.

Check that out and see if it would work for your application. If you have any other questions, just let me know.

Mark
03-10-2005, 10:24 AM
Hi Ninj,

Just a question, but have you tried using SUMBITWEB_POST instead of SUMBITWEB_GET?

Also are you sure that your firewall is letting TrueUpdate conntect to the Internet at all?

Ninj
03-14-2005, 12:35 AM
Hi Mark,

Truth is I've already tried to use the Post method before without any luck as well. However, last Friday, I tried playing with the timeout. I was finally able to upload using the Post method after I increased the timeout to 90.

Thanks for all the help :)

Mark
03-14-2005, 04:20 PM
Hi Mark,

Truth is I've already tried to use the Post method before without any luck as well. However, last Friday, I tried playing with the timeout. I was finally able to upload using the Post method after I increased the timeout to 90.

Thanks for all the help :)

Hi Ninj,

Thats great to hear! It would seem as though before your HTTP.Submit() action was timing out becuase your server did not have enough time to upload the file.