hey guys . been long since i used autoit... and was wondering if anyone can show me how to upload file to own website host without using ftp... preferably without any additional php html files too ? IF possible , if not il do it with php and html then looking forward to the replies this is for personal use and not for reselling . strickly.
Are you talking about a special kind of upload like many one-click hosters have? (Select file and upload)
Take a look on the package while you're sending the data. You'll see that these are sent with Boundaries. Some time ago I saw a tutorial here which was for VB but you can form it into AutoIt.
hey guys . been long since i used autoit... and was wondering if anyone can show me how to upload file to own website host without using ftp... preferably without any additional php html files too ? IF possible , if not il do it with php and html then looking forward to the replies this is for personal use and not for reselling . strickly.
You need a Protocol, either there is a server software installed on the webserver (like ftp) or you write your owen (if you have a virtual or root server).
The i guess the best way is ftp, if your web server doesnt support that, write a php script that recieves the data via HTTP webrequest
To your idea: Do you mean uploading from a browser, or from program that has a GUI?
If you mean a Program with a GUI, then:
Code:
;Client -----
$hFileOpen = FileOpen("File", 16)
$sFileRead = FileRead($hFileOpen)
$iLen = BinaryLen($sFileRead)
do
$iLen -= TcpSend(TcpHandle, StringRight($sFileRead, $iLen))
Until $iLen = 0
FileClose($hFileOpen)
; ------------
; Server -----
$iLen = "BinaryLen sent"
$hName = FileOpen("Name of file to be saved to", 16)
Do
$sRecv = TcpRecv(TcpHandle, 2048)
$iLen -= BinaryLen($sRecv)
FileWrite($hName, $sRecv)
Until $iLen = 0
FileClose($hName)
; ----------
yes i want to upload with program gui to my web server without using ftp but i dont understand your code , it looks like it uploads to another computer that has the client open with the port? no ?
It depends on which way you take to transfer the file.
There are multiple ways to bring a file on your webserver. One is a php-website based upload (One-Click-Hosters have that) or to use ftp which you don't want to use.
I don't see any reason not to use ftp. Why don't you want to use it?
I think, if you write your ftp username und pw in a autoit programm everyone who knows that the programm was written in autoit can easily get your logins.
The only thing you can do is work like a filehoster, but not with files you have to upload the file as a string or binary.
This is only a easy example how it could work, to create a file on your webserver named "test.au3" with content "blublublub". But if someone knows, how to upload files like this it would be a big vulnerability.
It depends on which way you take to transfer the file.
There are multiple ways to bring a file on your webserver. One is a php-website based upload (One-Click-Hosters have that) or to use ftp which you don't want to use.
I don't see any reason not to use ftp. Why don't you want to use it?
i dont want to use ftp as it is a harsh load on the app while logging in and like deluxe says someone can decrypt credentials.
Quote:
Originally Posted by DeluxeDose
I think, if you write your ftp username und pw in a autoit programm everyone who knows that the programm was written in autoit can easily get your logins.
The only thing you can do is work like a filehoster, but not with files you have to upload the file as a string or binary.
This is only a easy example how it could work, to create a file on your webserver named "test.au3" with content "blublublub". But if someone knows, how to upload files like this it would be a big vulnerability.
thanks i will try that right away ! seems good . i need something php or pure autoit based to upload a single file ...
EDIT : the script didnt work im afraid, doesnt upload to my host. yes ive added the php to the page etc... but script executes in like 0.4sec and done.
use ftp in a php script and call it from autoit.
So they dont know login data but can upload all what they want
but a php connection can get overloaded and crash ? thats what happens in autoit atleast.. too many ppl login on same ftp account and boom lag and crash even
can you maybe show me an example ? i do not have any idea how to use autoit + php together .
but a php connection can get overloaded and crash ? thats what happens in autoit atleast.. too many ppl login on same ftp account and boom lag and crash even
can you maybe show me an example ? i do not have any idea how to use autoit + php together .
Then you have to decrease the amount of available connections to a minimum.
If you set max. acceptable connections to 5 a normal webserver should have no issues at all.
Then you have to decrease the amount of available connections to a minimum.
If you set max. acceptable connections to 5 a normal webserver should have no issues at all.
sorry guys i dont know why in the world i wrote php. i meant ftp inside php ?
or is php ftp different from autoit ftp totaly?
EDIT : i found this very usefull but can you guys explain how can i make the php part where it says the new file name , how can i make that new filename change as what it would be in autoit when uploading ? or that would be imposible?