Login | |
|
 |
Re: Downloading a file - 6/5/2005 10:55:28 AM
|
|
 |
|
| |
TNO
Posts: 1303
Score: 12
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
|
The code is not working because there's a 404 error every time I try to access the page/file.
|
|
| |
|
|
|
 |
Re: Downloading a file - 6/5/2005 3:06:21 PM
|
|
 |
|
| |
TNO
Posts: 1303
Score: 12
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
|
ummm....what? First off, this code won't prompt the user. Second, the reason its not working is because you gave a bum link. I also have no idea if .htaccess rules will interfere or not.
|
|
| |
|
|
|
 |
Re: Downloading a file - 6/8/2005 10:44:17 AM
|
|
 |
|
| |
TNO
Posts: 1303
Score: 12
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
|
So you want an html page to auto download a picture to your computer? Why? your computer usually does this anyway. Take a look in your Temporary Internet folder. C:\Documents and Settings\USERNAME\Local Settings\Temporary Internet Files\
|
|
| |
|
|
|
 |
Re: Downloading a file - 6/9/2005 12:20:19 AM
|
|
 |
|
| |
Nembo
Posts: 5
Score: 0
Joined: 5/23/2005
From: Germany
Status: offline
|
I have a problem with it,too. Because .. i want it to get some files to check, whether my script has to download an update. I want to use it in this wayquote: Set FSO = WScript.CreateObject("Scripting.FileSystemObject") Set Folder = FSO.GetFolder(".") Function getremfile(ImageFile,DestFolder,URL) Set xml = CreateObject("Microsoft.XMLHTTP") xml.Open "GET", URL, False xml.Send set oStream = createobject("Adodb.Stream") Const adTypeBinary = 1 Const adSaveCreateOverWrite = 2 Const adSaveCreateNotExist = 1 oStream.type = adTypeBinary oStream.open oStream.write xml.responseBody oStream.savetofile DestFolder & ImageFile, adSaveCreateNotExist oStream.close set oStream = nothing Set xml = Nothing End Function getremfile "loginupdate.ini",Folder&"\","[...]/loginupdate.ini" getremfile "loginupdate.vbs",Folder&"\","[...]/loginupdate.vbs"
It works fine, but the ini file looks like this:quote: [Updater]#ver=18#size=0#[Files]#File0[...]
"#" is this stupid little box which should be "\n" In this way my script can't read the ini file. The file have to look like this: quote: [Updater] ver=18 size=0 [Files] File0 [...]
Is there any way to fix this ? I dont know much about working with strings in VBS. I just know about the PHP command $stringname = str_replace("#","\n",$stringname);
|
|
| |
|
|
|
 |
Re: Downloading a file - 6/9/2005 11:27:31 AM
|
|
 |
|
| |
TNO
Posts: 1303
Score: 12
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
|
For atu: Check this site for some helpful info: http://www.ericphelps.com/scripting/samples/BinaryDownload/ For Nembo: you have this: [Updater]#ver=18#size=0#[Files]#File0[...] and you want this?: [Updater] ver=18 size=0 [Files] File0 [...] Use the Split() and Join() functions to do this Split by # Join by vbnewline
|
|
| |
|
|
|
 |
Re: Downloading a file - 6/9/2005 1:29:42 PM
|
|
 |
|
| |
TNO
Posts: 1303
Score: 12
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
|
What code?
|
|
| |
|
|
|
 |
Re: Downloading a file - 6/10/2005 7:12:48 AM
|
|
 |
|
| |
Snipah
Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
|
Yo, TNO, did the code from EricPhelps.com help? 'cause some sites (like i.e. GeoCities) have it blocked that may be downloaded by i.e. Forums and other other downloaders...that may thru their .htaccess.....so i won't work with all URLz
|
|
| |
|
|
|
 |
Re: Downloading a file - 6/11/2005 5:19:38 PM
|
|
 |
|
| |
TNO
Posts: 1303
Score: 12
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
|
I don't remember where it came from, I was searching alot of places. I thought that htaccess rules might have limited the script same with <META> tags. Its probably easier to create an instance of IE and browse to the site and download with SendKey.
|
|
| |
|
|
|
 |
Re: Downloading a file - 6/13/2005 3:52:07 PM
|
|
 |
|
| |
TNO
Posts: 1303
Score: 12
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
|
"downloading a file from internet without prompting a user" The code I've given so far should be sufficient. If you are trying to silently download some questionable type of file I won't give you any help. The only thing I'll tell you is to convince your "clients" to lower their browser security settings for a perfect stranger (you). I might also give you some help if you can convince me that: #1) its for a legitimate reason. and #2) you put some effort into it and show me what you've come up with. (This is the 2nd post I've seen like this in 20 minutes.......)[V]
|
|
| |
|
|
|
 |
Re: Downloading a file - 6/15/2005 10:58:42 AM
|
|
 |
|
| |
TNO
Posts: 1303
Score: 12
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
|
I haven't tested this but I believe that this would work on any file copied into the temporary folder.
|
|
| |
|
|
|
|
|