Hallo,
ich habe ein Skript vor langer Zeit gefunden, welches Bilder auf Imageshack.us uploaden kann. Jetzt funktioniert das aber nicht mehr.. kann man das Skript wieder zum laufen bringen, oder gibt es andere Skripts wo Ich Bilder im Hintergrund uploaden kann?
Skript:
;~ =================> Imageshack Uploader
[/autoit][autoit][/autoit][autoit]Func _UploadTo_Imageshack($sFile, $sFlag = 0, $iRet_Type = 0)
[/autoit][autoit][/autoit][autoit]$sLocalFile = $sFile ;Local file
[/autoit][autoit][/autoit][autoit]$sHost = 'http://imageshack.us' ;Upload page addresss
[/autoit][autoit][/autoit][autoit]$sFormAction = '/upload_api.php' ;Upload form action ("form action=...upload.php)"
[/autoit][autoit][/autoit][autoit]$sFormName = 'fileupload' ;Upload form name ("input name=uploadfile")
[/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit]$sResponse = _TCPFileUpload($sLocalFile, $sHost, $sFormAction, $sFormName)
[/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit]Local $aRet[4] = _
[/autoit][autoit][/autoit][autoit][ _
[/autoit][autoit][/autoit][autoit]StringRegExpReplace($sResponse, '(?is).*<(image_link)>(.*?).*', '\2'), _
[/autoit][autoit][/autoit][autoit]StringRegExpReplace($sResponse, '(?is).*<(image_html)>(.*?).*', '\2'), _
[/autoit][autoit][/autoit][autoit]StringRegExpReplace($sResponse, '(?is).*<(image_bb)>(.*?).*', '\2'), _
[/autoit][autoit][/autoit][autoit]StringRegExpReplace($sResponse, '(?is).*<(image_bb2)>(.*?).*', '\2') _
[/autoit][autoit][/autoit][autoit]]
[/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit]If $sFlag = 1 Then FileDelete($sFile)
[/autoit][autoit][/autoit][autoit]Return $aRet[$iRet_Type]
[/autoit][autoit][/autoit][autoit]EndFunc
[/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit]Func _TCPFileUpload($sLocalFile, $sHost, $sFormAction, $sFormName)
[/autoit][autoit][/autoit][autoit]Local $sFileRead, $sFileType, $sBoundary, $sData, $iDataSize, $sHeader, $sCommand, $iSocket, $sRecv
[/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit]$sHost = StringRegExpReplace($sHost, '(?i)^https?://', '')
[/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit]$sFileRead = FileRead($sLocalFile)
[/autoit][autoit][/autoit][autoit]$sFileType = StringRegExpReplace($sLocalFile, '^.*\.', '')
[/autoit][autoit][/autoit][autoit]If $sFileType = 'jpg' Then $sFileType = 'jpeg'
[/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit]$sBoundary = StringFormat('----------------%s%s%smzF', @MIN, @HOUR, @SEC)
[/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit]$sData = '--' & $sBoundary & @CRLF & _
[/autoit][autoit][/autoit][autoit]'Content-Disposition: form-data; name="' & $sFormName & '"; filename="' & StringRegExpReplace($sLocalFile, '^.*\\', '') & '"' & @CRLF & _
[/autoit][autoit][/autoit][autoit]'Content-Type: image/' & $sFileType & @CRLF & @CRLF & _
[/autoit][autoit][/autoit][autoit]$sFileRead & @CRLF & '--' & $sBoundary & '--' & @CRLF
[/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit]$iDataSize = StringLen($sData)
[/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit]$sHeader = 'POST ' & $sFormAction & ' HTTP/1.1' & @CRLF & _
[/autoit][autoit][/autoit][autoit]'Host: ' & $sHost & @CRLF & _
[/autoit][autoit][/autoit][autoit]'Connection: close' & @CRLF & _
[/autoit][autoit][/autoit][autoit]'Content-Type: multipart/form-data; boundary=' & $sBoundary & @CRLF & _
[/autoit][autoit][/autoit][autoit]'Content-Length: ' & $iDataSize & @CRLF & @CRLF
[/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit]$sCommand = $sHeader & $sData
[/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit]TCPStartup()
[/autoit][autoit][/autoit][autoit]$iSocket = TCPConnect(TCPNameToIP($sHost), 80)
[/autoit][autoit][/autoit][autoit]TCPSend($iSocket, $sCommand)
[/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit]While 1
[/autoit][autoit][/autoit][autoit]$sRecv &= TCPRecv($iSocket, 20000)
[/autoit][autoit][/autoit][autoit]If StringLen($sRecv) <> 0 Then ExitLoop
[/autoit][autoit][/autoit][autoit]Sleep(50)
[/autoit][autoit][/autoit][autoit]WEnd
[/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit]TCPShutdown()
[/autoit][autoit][/autoit][autoit]Return $sRecv
[/autoit][autoit][/autoit][autoit]EndFunc
[/autoit]Fehlermeldung:
ZitatAlles anzeigenHTTP/1.1 200 OK
Server: nginx/1.0.4
Date: Mon, 30 Apr 2012 00:15:20 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: close
X-Powered-By: PHP/5.2.9
8c
You must provide a valid auth token or dev key. see http://code.google.com/p/imageshackapi/
</links>
0