Sign in to follow this  
Followers 0
klsgfx

Inetget - Local Filename

6 posts in this topic

#1 ·  Posted (edited)

Girls, Boys,

I have some trouble using InetGet().

According to the helpfile the second parameter ('Local Filename') should be optional.

But...

Example:

The URL I want to download from is something like: 'http://subdomain.domain.tld/file.php?var1=xy&var2=yz'

The script file.php sends a header with the filename, so when using a browser the download starts and a file like result-123.csv is saved.

How do I use InetGet for this. I do not know the filename for the downloaded file, because it is generated by the php script each time different and sent as header.

Using

InetGet('http://subdomain.domain.tld/file.php?var1=xy&var2=yz')

or

InetGet('http://subdomain.domain.tld/file.php?var1=xy&var2=yz', @DesktopDir)

will show no error besides that I cannot find any file downloaded. Where am I wrong?

Or does anyone know a different way to get this task done?

Any help would be appreciated.

Thanks in advance.

Klaus

Edited by klsgfx

Share this post


Link to post
Share on other sites



Hmm...

Nothing until now? <sigh />

Let me ask in a different way: function InetGet() has as second parameter the file name of the downloaded file. This parameter is (according to the help) optional.

So if I do not use this parameter, where can I find the downloaded file?

Really hope that someone has a hint for me.

Cheers

Klaus

Share this post


Link to post
Share on other sites

This is not a file. Take a look at the return code for Inetget.

It gives a file.

InetGet('http://subdomain.domain.tld/file.php?var1=xy&var2=yz', 'some_name.txt')

This will save a file called some_name.txt in the script's folder. But I do not know the filename before. So I skip this parameter.

When typing this URl in any browser's addressbar the browser will start a download and save that file with the name given by the php header.

And the default location for downloading with giving any parameters is your script location.

Only if I use the second parameter ('Local Filename').

Even

InetGet('http://subdomain.domain.tld/file.php')

will not save a file.

I give up.

Thanks for your answer.

Guess I have to use wget.

Have a good night.

Klaus

Share this post


Link to post
Share on other sites

Try this?

_INetGetSource("http://subdomain.domain.tld/file.php?var1=xy&var2=yz)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0