Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
html getflie geturl help
#1
I'm having a devil of a time trying to download a file from site that requires a login. I'm not if the error is my code or if it's something on the server side.

can you help me get this working using the forum's urls?
Code:
Copy      Help
ClearOutput
str a
Http c.Connect("http://www.quickmacros.com/forum" "my id" "my password")
Http b.GetUrl("http://www.quickmacros.com/forum/profile.php?mode=editprofile" &a)
out a


I'm trying to get text files from our server here, if that makes any difference to the "GetUrl" "GetFile" coding.

Thanks.
#2
Http works like this:

Code:
Copy      Help
str a
Http c.Connect("www.quickmacros.com" "username" "password")
c.FileGet("forum/profile.php?mode=editprofile" a)

At first, Connect to server, then, using the same variable, call FileGet one or more times. In this case (qm forum), username and password cannot be used here (you must be interactively logged in).
#3
im wanting to check to see if a file exists on a web site lets say "http://www.quickmacros.com/test.txt"

also im wanting to download that same file or other files and place them in my c drive

if this can be done can someone please help me Smile

thank you
#4
Code:
Copy      Help
str s
internet.IntGetFile("http://www.quickmacros.com/test.txt" s)
;ShowText "" s
if(find(s "<TITLE>404 Not Found</TITLE>")>=0)
,out "not found"
else
,s.setfile("$desktop$/test.txt")
#5
ok that works great to set the file on my hard drive ..... the if find didnt work, also im wanting to check to see if the file is there before i download it the code that you gave me downloads the file then checks to see if it failed .

thank you
#6
I think you'll have to download at least part of file, say 1KB. Then search for 404 not found. Is it OK?

To check if the file is there without downloading, you must have FTP access (password, etc), and use Ftp functions.
#7
are these valid syntaxes? ie can you use variables with all these?


Code:
Copy      Help
str dlurl newfln
IntGetFile(dlurl &s)
Dir d.dir(newfln)
run newfln
An old blog on QM coding and automation.

The Macro Hook
#8
Quote:can you use variables

Variables can be used with all user-defined functions.


Forum Jump:


Users browsing this thread: 1 Guest(s)