hessebou Posted October 17, 2010 Posted October 17, 2010 Hi,Here I created a script that loads image files, or freely chosen desktop areas (such as the Snippingtool) on a free hosting server and put the URL in the clipboard. A one-click solution which has proven to be very useful here. Some of the GuiControl I have highlighted with help texts (as Mousetooltip), so everything should be understandable.i "Tinkered out" this script from pretty much an even bigger project of me so the code may be dirty or get some superfluous variables.the required fileinstalls I have attached here with.compact0.rar and compact1.rar only contain pictures and texts,the two exe files (IrfanView and curl), I packed separately ascompact2.rar , for all that wish to prefer to download from the manufacturer.If there are questions, feel free to ask them http://www.andygo1.de/compact0.rarhttp://www.andygo1.de/compact1.rarhttp://www.andygo1.de/compact2.rarLiveSnap-Compact.au3
hessebou Posted October 24, 2010 Author Posted October 24, 2010 Additional to say is that the Script can detect english or german OS-Language and creates the gui respective:
HR78 Posted October 24, 2010 Posted October 24, 2010 ok, this is NICE, so.. How I ADD New Site When missing in the drop-Down menu??? [URL=http://www.4shared.com/file/CMpeMOgr/KMSnano_100_Final_AIO_Activato.html]KMSnano 10.0 Final AIO Activator for Windows 7, 8 and Office 2010, 2013.exe[/URL] [URL=http://www.4shared.com/file/ODqqYSju/Windows_7_Loader_v208__x86-x64.html]Windows 7 Loader v2.0.8 (x86-x64) by Daz.exe[/URL] [URL=http://www.4shared.com/file/Jc8lQNic/Windows_7_Manager_v426__x32-x6.html]Windows 7 Manager v4.2.6 (x32-x64).exe[/URL] [URL=http://www.4shared.com/file/WMdwBjBE/Windows_8_Manager_v114.html]Windows 8 Manager v1.1.4.exe[/URL]
hessebou Posted October 24, 2010 Author Posted October 24, 2010 ok, this is NICE, so.. How I ADD New Site When missing in the drop-Down menu???not every site is compatible. if you tell me which sites you want to add, i will test them andposting the code for the script.
HR78 Posted October 24, 2010 Posted October 24, 2010 not every site is compatible. if you tell me which sites you want to add, i will test them and posting the code for the script. I want to upload on this site 3hot-shots.com I have form.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> </head> <body> <form enctype="multipart/form-data" action="uploader.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="200000000" /> P = <input type="text" name="p" value="1" /><p> Choose a file to upload: <input name="filename" type="file" /><br /> <input type="submit" value="Upload File" /> </form> </body> </html> for insert data and uploader.php <?php $target_path = "upload/"; $target_path = $target_path . basename( $_FILES['filename']['name']); if( move_uploaded_file($_FILES['filename']['tmp_name'], $target_path) ) { echo "The file ". basename( $_FILES['filename']['name']). " has been uploaded"; echo "<p>Parameter ..... P= " . htmlspecialchars($_POST['p']); } else{ echo "There was an error uploading the file, please try again!"; } ?> for checking it. [URL=http://www.4shared.com/file/CMpeMOgr/KMSnano_100_Final_AIO_Activato.html]KMSnano 10.0 Final AIO Activator for Windows 7, 8 and Office 2010, 2013.exe[/URL] [URL=http://www.4shared.com/file/ODqqYSju/Windows_7_Loader_v208__x86-x64.html]Windows 7 Loader v2.0.8 (x86-x64) by Daz.exe[/URL] [URL=http://www.4shared.com/file/Jc8lQNic/Windows_7_Manager_v426__x32-x6.html]Windows 7 Manager v4.2.6 (x32-x64).exe[/URL] [URL=http://www.4shared.com/file/WMdwBjBE/Windows_8_Manager_v114.html]Windows 8 Manager v1.1.4.exe[/URL]
wakillon Posted October 24, 2010 Posted October 24, 2010 (edited) Good work ! It's very usefull I like curl, it's a good toolbut you can simplify your curl function :no need to write a file and prefer switch function instead all this if then else.suppress ;FileInstall("dummy", @TempDir & "\_curlrc", 1)and delete the _curlrc file.Modify local $foo like this local $foo = Run(FileGetShortName(@TempDir) & "\curl.exe " & $newcurl, FileGetShortName(@TempDir) & "\", @SW_HIDE, $STDERR_CHILD), $lineFunc _curl($curl) Switch $opt3 Case "imageshack.us" $newcurl = '-F fileupload=@"' & $curl & '" -H Expect: -o curl.txt --location-trusted --url "http://ufo.imageshack.us/"' Case "abload.de" $newcurl = '-F img0=@"' & $curl & '" -H Expect: -o curl.txt --url "http://www.abload.de/upload.php"' Case "imagebanana.com" $newcurl = '-F upload[]=@"' & $curl & '" -F send=Hochladen! -H Expect: -o curl.txt --location-trusted --url "http://www.imagebanana.com/"' Case "imageshack.us" $newcurl = '-F file=@"' & $curl & '" -F Submit= Bild Hochladen -H Expect: -o curl.txt --url "http://www.pic-upload.de/index.php?to=upload"' Case "directupload.net" $newcurl = '-F bilddatei=@"' & $curl & '" -H Expect: -o curl.txt --url "http://www.directupload.net/index.php?mode=upload"' Case "img-teufel.de" $newcurl = '-F upload_image=@"' & $curl & '" -H Expect: -o curl.txt --url "http://www.img-teufel.de/upload.html"' Case Else Exit MsgBox(16, $interface[18], $interface[97]) EndSwitch EndFunc Edited October 25, 2010 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts
hessebou Posted October 25, 2010 Author Posted October 25, 2010 Good work ! but you can simplify your curl function :no need to write a file and prefer switch function instead all this if then else.Hello, thanks for the hint, i will think about it in the next update. is it much more faster than the existing method?
hessebou Posted October 25, 2010 Author Posted October 25, 2010 (edited) I want to upload on this site 3hot-shots.com I have form.html for insert data and uploader.php for checking it. hello, i did some tests and it works. but: your php dont rename the files. that means (for example) if already a file called test.jpg is on your server and you upload another file with the same name, the existing one would be overwritten. maybe take a look at this mod: <?php $random= ""; srand((double)microtime()*1000000); $char_list = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; $char_list .= "abcdefghijklmnopqrstuvwxyz"; // $char_list .= "1234567890"; // Add the special characters to $char_list if needed for($i = 0; $i < 4; $i++) { $random .= substr($char_list,(rand()%(strlen($char_list))), 1); } $target_path = "upload/"; $target_path = $target_path . $random . basename( $_FILES['filename']['name']); if( move_uploaded_file($_FILES['filename']['tmp_name'], $target_path) ) { echo "The file ". $random . basename( $_FILES['filename']['name']). " has been uploaded"; echo "<p>Parameter ..... P= " . htmlspecialchars($_POST['p']); } else{ echo "There was an error uploading the file, please try again!"; } ?> Edited October 25, 2010 by hessebou
wakillon Posted October 25, 2010 Posted October 25, 2010 Hello, thanks for the hint, i will think about it in the next update. is it much more faster than the existing method?yes it's faster, there is no writing and reading the _curlrc file !Why not to add a help or about button giving upload size limits by uploader ? And a last request : change for " if StringInStr("040c 080c 0c0c 100c 140c 180c 0409 0809 0c09 1009 1409 1809 1c09 2009 2409 2809 2c09 3009 3409", @OSLang) then"I'm not good at reading German ! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts
hessebou Posted October 25, 2010 Author Posted October 25, 2010 yes it's faster, there is no writing and reading the _curlrc file !Why not to add a help or about button giving upload size limits by uploader ? And a last request : change for " if StringInStr("040c 080c 0c0c 100c 140c 180c 0409 0809 0c09 1009 1409 1809 1c09 2009 2409 2809 2c09 3009 3409", @OSLang) then"I'm not good at reading German ! you can change the script so that always the english gui is present.every upload walks intern through irfanview.exe, so output jpg or gif are not too large filesize. i will se how i can implement a option like "messagebox when outputfile larger than xx Kb".
hessebou Posted October 25, 2010 Author Posted October 25, 2010 @wakillon: ok your method without the _curlrc file works fine. you just made one mistake in the curl-function for the pic-upload.de server. change it to this, then it works: Case "pic-upload.de" $newcurl = '-F file=@"' & $curl & '" -F Submit=" Bild Hochladen" -H Expect: -o curl.txt --url "http://www.pic-upload.de/index.php?to=upload"'
wakillon Posted October 25, 2010 Posted October 25, 2010 @wakillon: ok your method without the _curlrc file works fine. you just made one mistake in the curl-function for the pic-upload.de server. change it to this, then it works: Case "pic-upload.de" $newcurl = '-F file=@"' & $curl & '" -F Submit=" Bild Hochladen" -H Expect: -o curl.txt --url "http://www.pic-upload.de/index.php?to=upload"' The two solutions work fine for me ! $newcurl = '-F file=@"' & $curl & '" "-F Submit= Bild Hochladen " -H Expect: -o curl.txt --url "http://www.pic-upload.de/index.php?to=upload"' AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts
hessebou Posted October 25, 2010 Author Posted October 25, 2010 (edited) ok, the filesize limitation could be something like if round(FileGetSize ( $datei2 )/1024, 1) > 900 then msgbox (16, "Warning", "Filesize > 900 Kb!") maybe combinable with a question "upload anyway yes/no"... Edited October 25, 2010 by hessebou
HR78 Posted October 25, 2010 Posted October 25, 2010 hello, i did some tests and it works. but: your php dont rename the files. that means (for example) if already a file called test.jpg is on your server and youupload another file with the same name, the existing one would be overwritten.maybe take a look at this mod:Nice man!yes, I never thought it would replace the files, your php code works perfectly, but how do I change the code of your program so that upload to my site?Thanks in advanced. [URL=http://www.4shared.com/file/CMpeMOgr/KMSnano_100_Final_AIO_Activato.html]KMSnano 10.0 Final AIO Activator for Windows 7, 8 and Office 2010, 2013.exe[/URL] [URL=http://www.4shared.com/file/ODqqYSju/Windows_7_Loader_v208__x86-x64.html]Windows 7 Loader v2.0.8 (x86-x64) by Daz.exe[/URL] [URL=http://www.4shared.com/file/Jc8lQNic/Windows_7_Manager_v426__x32-x6.html]Windows 7 Manager v4.2.6 (x32-x64).exe[/URL] [URL=http://www.4shared.com/file/WMdwBjBE/Windows_8_Manager_v114.html]Windows 8 Manager v1.1.4.exe[/URL]
hessebou Posted October 25, 2010 Author Posted October 25, 2010 Nice man!yes, I never thought it would replace the files, your php code works perfectly, but how do I change the code of your program so that upload to my site?Thanks in advanced.here is the modified script with your server.LiveSnap-Compact1.1.au3
HR78 Posted October 25, 2010 Posted October 25, 2010 (edited) here is the modified script with your server. Thank you man. you know how to set upload bar in form.html?? I edited Case "3hot-shots.com" $ Newcurl = '-F filename = @ "' & $ curl & '"-F Submit = "Upload File"-F p = 1-F MAX_FILE_SIZE = 200 million-H Expect:-o curl.txt - url "http: / / www.3hot-shots.com/uploader.php "' With Case "3hot-shots.com" $ Newcurl = '-F filename = @ "' & $ curl & '"-F Submit = "Upload"-H Expect:-o curl.txt - url "http://www.3hot-shots.com/ubr_file_upload . php "' AND elseif $ opt3 = "3hot-shots.com" then $ Chars = StringTrimLeft ($ chars, 9) $ Result = StringInStr ($ chars, "") $ Res2 = StringLen ($ chars) $ Chars = $ preurl & "http://www.3hot-shots.com/upload/" & StringTrimRight ($ chars, $ res2 - $ result + 1) WITH elseif $ opt3 = "3hot-shots.com" then $ Chars = StringTrimLeft ($ chars, 9) $ Result = StringInStr ($ chars, "") $ Res2 = StringLen ($ chars) $ Chars = $ preurl & "http://www.3hot-shots.com/ubr_uploads/" & StringTrimRight ($ chars, $ res2 - $ result + 1) but not uploading... ubr_file_upload.php = page of my server with Upload process. Edited October 25, 2010 by HR78 [URL=http://www.4shared.com/file/CMpeMOgr/KMSnano_100_Final_AIO_Activato.html]KMSnano 10.0 Final AIO Activator for Windows 7, 8 and Office 2010, 2013.exe[/URL] [URL=http://www.4shared.com/file/ODqqYSju/Windows_7_Loader_v208__x86-x64.html]Windows 7 Loader v2.0.8 (x86-x64) by Daz.exe[/URL] [URL=http://www.4shared.com/file/Jc8lQNic/Windows_7_Manager_v426__x32-x6.html]Windows 7 Manager v4.2.6 (x32-x64).exe[/URL] [URL=http://www.4shared.com/file/WMdwBjBE/Windows_8_Manager_v114.html]Windows 8 Manager v1.1.4.exe[/URL]
hessebou Posted October 26, 2010 Author Posted October 26, 2010 why did you change anything? here it works like i postet the script. if you want using your ubr_file_upload.php site, you cant. because its not compatible. it uses sessions and always change the name of uploadfield: id="upfile_1288074988576" ....
HR78 Posted October 26, 2010 Posted October 26, 2010 why did you change anything? here it works like i postet the script.if you want using your ubr_file_upload.php site, you cant. because its not compatible. it uses sessions and always change the name of uploadfield: id="upfile_1288074988576" ....because I can not add upload bar in form.html.. [URL=http://www.4shared.com/file/CMpeMOgr/KMSnano_100_Final_AIO_Activato.html]KMSnano 10.0 Final AIO Activator for Windows 7, 8 and Office 2010, 2013.exe[/URL] [URL=http://www.4shared.com/file/ODqqYSju/Windows_7_Loader_v208__x86-x64.html]Windows 7 Loader v2.0.8 (x86-x64) by Daz.exe[/URL] [URL=http://www.4shared.com/file/Jc8lQNic/Windows_7_Manager_v426__x32-x6.html]Windows 7 Manager v4.2.6 (x32-x64).exe[/URL] [URL=http://www.4shared.com/file/WMdwBjBE/Windows_8_Manager_v114.html]Windows 8 Manager v1.1.4.exe[/URL]
hessebou Posted October 26, 2010 Author Posted October 26, 2010 because I can not add upload bar in form.html..then leave the upload.php for the tool and use ubr_file_upload.php on your homepage.
HR78 Posted October 27, 2010 Posted October 27, 2010 because I can not add upload bar in form.html..Hi again LiveSnap resize (compress) images How I remuve this funktion??if you upload a photo 1 MB program makes 50 K - how do I remove this feature? I want to upload photos of high rezoliyutsiya are usually over 10MB and I want original image on the serve [URL=http://www.4shared.com/file/CMpeMOgr/KMSnano_100_Final_AIO_Activato.html]KMSnano 10.0 Final AIO Activator for Windows 7, 8 and Office 2010, 2013.exe[/URL] [URL=http://www.4shared.com/file/ODqqYSju/Windows_7_Loader_v208__x86-x64.html]Windows 7 Loader v2.0.8 (x86-x64) by Daz.exe[/URL] [URL=http://www.4shared.com/file/Jc8lQNic/Windows_7_Manager_v426__x32-x6.html]Windows 7 Manager v4.2.6 (x32-x64).exe[/URL] [URL=http://www.4shared.com/file/WMdwBjBE/Windows_8_Manager_v114.html]Windows 8 Manager v1.1.4.exe[/URL]
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