Simon wrote:Hi alemrantareq,
Actually you just have to give us the real URL to the file.
I'm sure I can think of a name of a file that's not there
Simon
Nope, the file exists in the server. If I put the file url in IDM, it downloads the file successfully. But I can't catch the file through rev
Is there any way to call IDM & post the url in IDM to download the file automatically? I'm talking abt auto script !! I wonder if its really possible for rev
put URL "http://mysiteurl.com/file.rar" into myData
put the result into rslt
if rslt is empty then
answer "Found"
else
answer "Not Found"
end if
Works fine on my server, if the file is there it says Found, if the file is not there it says Not Found.
Of course I use a URL towards my server.
What I was asking was for you to post your real URL (Not http://mysiteurl.com/) so that we could test what the feedback was from your server.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
You only want to check for files on one server, right?
So the file will either be there or you'll get whatever page you get at that website when there's a file not found.
You almost had it with...
"put URL "http://thesiteurl.com/file.rar" into myData
put the result into rslt
if rslt contains "file.rar" then
// download will start"
Instead test for the opposite, test for html from the failure page.
Like this...
put URL "http://thesiteurl.com/bogusfile.pox" into msg
This will give you the html for the failure page.
Then use some string from that failure page to do your test.
put URL "http://thesiteurl.com/file.rar" into myData
if theFailString is in myData then
exit to top // or whatever, it's a fail
else
//download as planned
end if
Well guys, thanks a lot for the replies. I've tried all the codes that you suggested; but my bad, I always get the same result whether the file exists or not.
Did you check the link with IDM? It starts the download immediately both in IDM & in my browsers !!! If your browser doesn't integrated with IDM, then the link wont work.
on mouseUp
put URL "http://www.philmrev.on-rev.com/dragon.png" into myData
put the result into rslt
if rslt is empty then
answer "Found"
else
answer "Not Found"
end if
end mouseUp
Yes bro, your code works for other files perfectly. But I actually want to download from that server. IDM = Internet Download Manager. I think that server uses a javascript to download the file which can be caught by IDM perfectly.
Would have helped here if you mentioned that you were using a 3rd party product to download.
"put url" only grabs the file at the given url not implement a downloader.
It wont work in your application.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Might try starting up a hidden revbrowser instance, point it to the location and see if it will kick in the download manager.
If it works you might be able to use the browserdownloadrequest message which will hopefully give you the actual real url to the download (rather than the mangled indirect one they have you use so that the download manager etc can be brought into play)
Hopefully though the download manager will kick in on its own and you can just let it do it's thing. Hopefully any installed IDM plugin will still work through revbrowser.
Dear sturgis, thanks for the reply. Well, I never used hidden revbrowser instance and browserdownloadrequest message in any of my past projects. I've gone through the dictionary; but its not sufficient for me to start with. Can you please give me a sample script; so that I can go into deep of it. Thanks
You might want to click the resources button on the livecode coolbar, then open up the internet section on the left. Then click on "browser sampler" and download the stack.
You can learn a lot about the revbrowser that way.
Don't have time this morning to give an example but..
In the dictionary look at revbrowseropen, revbrowserclose, browserdocumentcomplete, anything starting with revbrowser
Also look at browserdownloadrequest.. If you receive that message it is possible that the url that is passed in the message is the real download URL so if the download doesn't start automatically you might be able to use that url and manually start your download manager (maybe using launch or shell or even open process) and pass the url to it.