spyrorocks Posted January 19, 2007 Share Posted January 19, 2007 OK, this question is for guys who know a litle about web-based autoit. Im trying to make my script popup the download screen to download a file, but the script does some processing first and the user cannot know the direct link to the file. This is what i got so far: consolewrite("HTTP/1.1 200 OK" & @LF) consolewrite("Content-Type: application/force-download" & @LF) consolewrite('Content-Transfer-Encoding: Binary' & @LF); consolewrite('Content-Length: '&filegetsize('hello.exe') &@LF); consolewrite('Content-Disposition: attachment; filename="hello.exe"' & @LF & @LF) consolewrite(binarystring(fileread("hello.exe"))) it pops up the download screen, saves it, but the downlaoded data is corruptred. Any ideas what im doing wrong? [center] My Projects: Online AutoIt Compiler - AutoForum - AutoGuestbook - AutoIt Web-based Auto Installer - Pure AutoIt Zipping Functions - ConfuseGen - MindReader - P2PChat[/center] Link to comment Share on other sites More sharing options...
NELyon Posted January 19, 2007 Share Posted January 19, 2007 What happens if you just use a regular HTML file? Maybe hello.exe is corrupted itself Link to comment Share on other sites More sharing options...
spyrorocks Posted January 19, 2007 Author Share Posted January 19, 2007 Its not. Trust me. I dont want a regular html file, i need a exe or zip that will download. [center] My Projects: Online AutoIt Compiler - AutoForum - AutoGuestbook - AutoIt Web-based Auto Installer - Pure AutoIt Zipping Functions - ConfuseGen - MindReader - P2PChat[/center] Link to comment Share on other sites More sharing options...
SuperMcFlourish Posted January 19, 2007 Share Posted January 19, 2007 consolewrite(binarystring(fileread("hello.exe")))the exe is already a binary string i believe, which autoit doesn't support raw, maybe try thishttp://www.autoitscript.com/forum/index.php?showtopic=21815 Announceing a line of new Apple products: the iDontCare and the iSuck, with the code based off their iCrashtoHellAlot ox.10, with a new GUI based on a zebra, panda bear, coyote, lollipop, and a can of tuna. Link to comment Share on other sites More sharing options...
spyrorocks Posted January 19, 2007 Author Share Posted January 19, 2007 Well, i dont know what thats supposto mean.. [center] My Projects: Online AutoIt Compiler - AutoForum - AutoGuestbook - AutoIt Web-based Auto Installer - Pure AutoIt Zipping Functions - ConfuseGen - MindReader - P2PChat[/center] Link to comment Share on other sites More sharing options...
SuperMcFlourish Posted January 19, 2007 Share Posted January 19, 2007 but it returns MZ, unless you know of a workaround? Announceing a line of new Apple products: the iDontCare and the iSuck, with the code based off their iCrashtoHellAlot ox.10, with a new GUI based on a zebra, panda bear, coyote, lollipop, and a can of tuna. Link to comment Share on other sites More sharing options...
spyrorocks Posted January 19, 2007 Author Share Posted January 19, 2007 It returns 3 bytes of the data that is supposto be 16 kb. Maybe read each character at once, then return it as a binary string? [center] My Projects: Online AutoIt Compiler - AutoForum - AutoGuestbook - AutoIt Web-based Auto Installer - Pure AutoIt Zipping Functions - ConfuseGen - MindReader - P2PChat[/center] Link to comment Share on other sites More sharing options...
Bert Posted January 19, 2007 Share Posted January 19, 2007 several questions... 1. Why can't the user know? 2. Why does it need to be forced? 3. Why can't the user know the direct link to the file? All this is VERY suspicious, as in you are trying to do a nono .... as in trying to hijack someone's PC... Could you explain the whole thing you are trying to do, and not just the part you are having trouble with? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
AzKay Posted January 19, 2007 Share Posted January 19, 2007 several questions...1. Why can't the user know?2. Why does it need to be forced?3. Why can't the user know the direct link to the file?All this is VERY suspicious, as in you are trying to do a nono .... as in trying to hijack someone's PC...Could you explain the whole thing you are trying to do, and not just the part you are having trouble with?If he wanted to hijack a pc, he would just probly use an INetGet. Lol.Anyway, They'll be able to find the direct link anyway with any type of packet sniffer. # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
CoePSX Posted January 19, 2007 Share Posted January 19, 2007 (edited) Set the mime type to application/octet-stream. It's common to do this in php for download redirectors. header('Content-Type: application/octet-stream');. EDIT: sorry, i miss understood the problem. Edited January 19, 2007 by CoePSX [quote name='Valik' post='301213' date='Jan 31 2007, 10:36 PM']You seem to have a habit of putting things in the wrong place. I feel sorry for any female you attempt to have sex with.[/quote][font="Lucida Sans Unicode"]╔══════════════════════════════╗║░░██░░░░░░░░██░░███░░░████░░░█║║░█░░█░░██░░█░░█░█░░█░█░░░░█░█░║║░█░░░░█░░█░████░███░░░██░░░█░░║║░█░░█░█░░█░█░░░░█░░░░░░░█░█░█░║║░░██░░░██░░░██░░█░░░░███░█░░░█║╚══════════════════════════════╝[/font] 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