PDA

View Full Version : Bug with HTTP.Download?


Dnixon
04-10-2008, 08:42 AM
All of a sudden my True Update application is failing on a few computers, but not all of them are running it. It is very strange. They all were working about a week or two ago. Now some do and some don't. It seems to be related to the True Update application, and not the different operating systems.

What's happening is I get an error saying argument 1 of my HTTP.Download call has to be of a type string...but it is. Here's my code:



g_SourceURL = "http://m-repro.com/update_bpv1.5-2.exe";
g_PatchFileDest = SessionVar.Expand("%SourceFolder%\\Patches\\update_bpv1.5-2.exe");
g_HTTPTimeout = 30;
g_HTTPPort = 80;
g_HTTPTransferType = MODE_BINARY;
tableBasicAuthData = nil;

HTTP.Download(g_SourceURL, g_PatchFileDest, g_HTTPTransferType, g_HTTPTimeout, g_HTTPPort, tableBasicAuthData);



If I replace the variable in argument 1 with "http://m-repro.com/update_bpv1.5-2.exe" I don't get that error, but I get a new one. It says argument 2 must be of a type string. My code at that point looks like this:



g_PatchFileDest = SessionVar.Expand("%SourceFolder%\\Patches\\update_bpv1.5-2.exe");
g_HTTPTimeout = 30;
g_HTTPPort = 80;
g_HTTPTransferType = MODE_BINARY;
tableBasicAuthData = nil;

HTTP.Download("http://m-repro.com/update_bpv1.5-2.exe", g_PatchFileDest, g_HTTPTransferType, g_HTTPTimeout, g_HTTPPort, tableBasicAuthData);



It seems to be a bug with the HTTP.Download call, in my opinion, but I don't really know at this point. Any ideas from the Indigo Rose staff?

Thanks.

Dnixon
04-10-2008, 09:45 AM
Well, I changed my download method from HTTP to FTP, and I get the same error, so I don't know at this point. This time it says argument 1 of my FTPWI.Download call must be of type string. Here is my code:



g_SourceAddress = "208.109.83.188/update_bpv1.5-3.exe";
g_PatchFileDest = SessionVar.Expand("%SourceFolder%\\Patches\\update_bpv1.5-3.exe");
g_FTPPort = 21;
g_FTPTimeout = 30;
g_FTPUsername = "username";
g_FTPPassword = "password";
g_FTPUsePassiveMode = true;
g_FTPTransferType = MODE_BINARY;

FTPWI.Download(g_SourceAddress, g_PatchFileDest, g_FTPUsername, g_FTPPassword, g_FTPTransferType, g_FTPTimeout, g_FTPPort, g_FTPUsePassiveMode);




I'm guessing my variable g_SourceAddress isn't of a type string...I guess I don't quite understand what a string type is because I though mine was. Any ideas out there?

Adam
04-10-2008, 02:56 PM
Not sure about the second part but in your original HTTP download one you are missing the arguments 'ProxyData' and 'CallbackFunction'.


HTTP.Download(g_SourceURL, g_PatchFileDest, g_HTTPTransferType, g_HTTPTimeout, g_HTTPPort, tableBasicAuthData);


Should be:


HTTP.Download(g_SourceURL, g_PatchFileDest, g_HTTPTransferType, g_HTTPTimeout, g_HTTPPort, tableBasicAuthData, nil, nil);


Adam Kapilik

Dnixon
04-10-2008, 05:06 PM
I still haven't figured it out either. It's interesting to note that my code was generated by the TU wizard...I didn't write it from scratch.

Mark
04-14-2008, 12:17 PM
Hi Dnixon,

Is that the entirety of the code that you are running? Or are there some actions in between? I.e. some actions that may change the values of your variables?

What happens if you use a Dialog.Message() action to display your variables before you run your HTTP or FTPWI actions? What does the Dialog display? What are the values of your variables?