klsgfx Posted September 20, 2007 Share Posted September 20, 2007 (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.UsingInetGet('http://subdomain.domain.tld/file.php?var1=xy&var2=yz')orInetGet('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 September 20, 2007 by klsgfx Link to comment Share on other sites More sharing options...
klsgfx Posted September 20, 2007 Author Share Posted September 20, 2007 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 Link to comment Share on other sites More sharing options...
DjDeep00 Posted September 20, 2007 Share Posted September 20, 2007 'http://subdomain.domain.tld/file.php?var1=xy&var2=yz'This is not a file. Take a look at the return code for Inetget. And the default location for downloading with giving any parameters is your script location. Link to comment Share on other sites More sharing options...
klsgfx Posted September 20, 2007 Author Share Posted September 20, 2007 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 Link to comment Share on other sites More sharing options...
Killer Posted September 23, 2007 Share Posted September 23, 2007 Try this? _INetGetSource("http://subdomain.domain.tld/file.php?var1=xy&var2=yz) Link to comment Share on other sites More sharing options...
klsgfx Posted September 25, 2007 Author Share Posted September 25, 2007 Try this?_INetGetSource("http://subdomain.domain.tld/file.php?var1=xy&var2=yz)This leaves me with the same problem: I have the data in a variable, but do not know the filename which is sent by php via a head-command.But I will use this for some other reasons.Thank you. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now