Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Use default filename from: IntGetFile
#1
I have a link like this (does not work, is just example link):
http://www.somesite.com/content/images/ ... hp?id=a123

If I open it with Firefox, I get:

[Image: intgetgile_filename.jpg]

Is it possible to use the 'default' filename (see image), when using the function IntGetFile
(So I do not have to specify the filename myself)

I use the function like this:

Macro Macro26
Code:
Copy      Help
str save_location="d:\_TEMP\_2\5MB.zip"
str download="http://www.somesite.com/content/images/categorie/download.php?id=a123"
IntGetFile download  save_location 16 0 1

But now I want use the function IntGetFile without giving a filename (see above code example: save_location) .
Is it possible to use the function in such a way so that it uses the the default filename.
(just like you would when you would input the url directly in the browser).

The extra problem here is that there is no direct link to the file, but only to the file-id
somesite.com/content/images/categorie/download.php?id=a123
#2
Get filename from received HTTP headers.

Macro Macro2129
Code:
Copy      Help
str save_location="$temp$\temp_filename.tmp"
str download="http://www.quickmacros.com/test/test.php"
str headers
IntGetFile download save_location 16 0 1 0 0 headers
;out headers
str fn
if(findrx(headers "(?mi)^Content-Disposition:.*\bfilename *= *([^;[]]+)" 0 0 fn 1)<0) out "filename unknown"; ret
;out fn
fn-_s.getpath(save_location)
;out fn
FileMove save_location fn 2
run fn
#3
THANK YOU!!!!!!!


Forum Jump:


Users browsing this thread: 1 Guest(s)