Page 2 of 2

Re: Upload an Download Problem^^

Posted: Sun Jan 10, 2010 1:02 pm
by bangkok
Very strange indeed.

I see a last source of problem : the exact filepath of the file located on the FTP server. You're talking about "test.zip".

If your FTP server is XX.XX.XX.XX are you sure that "test.zip" can be found in XX.XX.XX.XX/test.zip ?

And another thing that could help you : change the downloadComplete handler, by adding the status (parameters back). You'll see if the error is coming from the FTP server.

on downloadComplete pURL, pStatus
answer pURL
answer pStatus
hide scrollbar "progressbar"
end downloadComplete

Re: Upload an Download Problem^^

Posted: Sat Jan 16, 2010 12:00 pm
by MasterchiefJB
Well I contacted Klaus and he found out that my Downloadlink is correct but the FTP Server adds an Underscore to the Downloadlink and gives error 550 Can't open /lego/newmod2.zip_: No such file or directory back.

Correct Link I send: ftp://xxx:xxx@ftp.xxx.org/lego/newmod2.zip
Link I get back ftp://xxx:xxx@ftp.xxx.org/lego/newmod2.zip_


If anyone has an Idea why the server adds an underscore after my Downloadlink please tell me. I also took an indeep look into my scripts and nowere is an Underscore contained, so my scripts shouldn´t be the error.

Any help will be appreciated,
Masterchief

Re: Upload an Download Problem^^

Posted: Mon Jan 18, 2010 8:03 pm
by MasterchiefJB
So, today I got an answer to my questions and this is the mail:
"Dear Masterchief,

However, if the server is adding an underscore, then there is nothing Rev can do.
The issue is with the server and you will need to contact their admin to see why
it happens. Your script can remove the underscore though. Before you try to
download, check to see if there is an underscore before the final dot (".") and if
so, just remove it."

Thanks to the support I got a hint and asked the Hoster but they can´t do anything about it (for security reasons) and so I would like to know how I could script the method the support describes here:
"Your script can remove the underscore though. Before you try to
download, check to see if there is an underscore before the final dot (".") and if
so, just remove it"
Well I don´t have a clue to that and if anybody could give me a hint, it will be appreciated.

Best Regards,
Masterchief

Re: Upload an Download Problem^^

Posted: Tue Jan 19, 2010 12:20 pm
by Janschenkel
Stripping off the underscore can be done using this function:

Code: Select all

function RemoveUnderscoreBeforeExtension pPath
   local tPath, tFile
   --
   put pPath into tPath
   set the itemDelimiter to slash
   put the last item of tPath into tFile
   set the itemDelimiter to "."
   if the number of items in tFile > 1 and the last char of item -2 of tFile is "_" then
      put empty into the last char of item -2 of tFile
   end if
   set the itemDelimiter to slash
   put tFile into the last item of tPath
   return tPath
end RemoveUnderscoreBeforeExtension
HTH,

Jan Schenkel.

Re: Upload an Download Problem^^

Posted: Tue Jan 19, 2010 12:24 pm
by Klaus
Hi Jan and all,

that is just too easy!

This is the real problem, and this is nothing we can change so far!!!!!
...but the FTP Server adds an Underscore to the Downloadlink and gives error
550 Can't open /lego/newmod2.zip_: No such file or directory !! :!: :!: :!:
back.

Correct Link I send: ftp://xxx:xxx@ftp.xxx.org/lego/newmod2.zip
Link I get back ftp://xxx:xxx@ftp.xxx.org/lego/newmod2.zip_
Best

Klaus

Re: Upload an Download Problem^^

Posted: Tue Jan 19, 2010 12:31 pm
by Janschenkel
Ah, heh, I should have read the complete history, not just the last entry where MasterChief copied the reply from support and was asking how to strip off an underscore before the extension. Well, it's all up to the server admin then...

Jan Schenkel.

Re: Upload an Download Problem^^

Posted: Tue Jan 19, 2010 4:39 pm
by MasterchiefJB
Well I didn´t solve the problem but I got it working using http instead ftp. I don´t know why but I had just to change ftp:// into http:// and now it works.
Thanks everyone who helped me;)

The last thing I would like to know is the fact that

Code: Select all

libURLDownloadToFile myFile,newPath,"downloadComplete"
contains the filepath where the new file should be stored but how can I embend the original filename into the filepath?

I would assume to do it with

Code: Select all

 put "C:\myApp" into tpath
put tFilenameToDownload after tpath
libURLDownloadToFile tFilenameToDownload,tpath,"downloadComplete
But I am not sure. (I will give it a try when I got home^^)

Best Regards,
Masterchief