uploading file without ftp ?

12/17/2014 19:18 fear-x#1
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.
12/17/2014 21:19 alpines#2
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.
12/18/2014 01:00 warfley#3
Quote:
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
12/18/2014 02:28 fear-x#4
can you guys show me php + autoit examples?

EDIT : i dont want to do FTP ( which ive used so far ) but it limits multiple users connect simultenously right?
12/18/2014 21:45 FacePalmMan#5
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)
; ----------
12/19/2014 00:17 fear-x#6
Quote:
Originally Posted by FacePalmMan View Post
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 ?
12/19/2014 14:50 alpines#7
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?
12/19/2014 16:05 DeluxeDose#8
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.

PHP-File
PHP Code:
<?php
    $file 
fopen($_POST['_filename'], "w+");
    
fwrite($file,$_POST['sorce']);
    
fclose($file);
?>
AuotIT-File
PHP Code:
$obj ObjCreate("Microsoft.XMLHTTP")
$obj.open("POST","www.yoursite.to/index.php",False)
$obj.setRequestHeader('Content-Type','application/x-www-form-urlencoded')
$obj.send("_filname=test.au3&sorce=blublublub"
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.
12/19/2014 23:37 fear-x#9
Quote:
Originally Posted by alpines View Post
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 View Post
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.

PHP-File
PHP Code:
<?php
    $file 
fopen($_POST['_filename'], "w+");
    
fwrite($file,$_POST['sorce']);
    
fclose($file);
?>
AuotIT-File
PHP Code:
$obj ObjCreate("Microsoft.XMLHTTP")
$obj.open("POST","www.yoursite.to/index.php",False)
$obj.setRequestHeader('Content-Type','application/x-www-form-urlencoded')
$obj.send("_filname=test.au3&sorce=blublublub"
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.
12/20/2014 17:09 YatoDev#10
use ftp in a php script and call it from autoit.
So they dont know login data but can upload all what they want
12/20/2014 18:11 fear-x#11
Quote:
Originally Posted by »FlutterShy™ View Post
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 .
12/20/2014 19:45 YatoDev#12
Quote:
Originally Posted by fear-x View Post
but a php connection can get overloaded and crash ?
no.
Just use google....
12/20/2014 19:49 alpines#13
Quote:
Originally Posted by fear-x View Post
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.
12/20/2014 21:29 fear-x#14
Quote:
Originally Posted by »FlutterShy™ View Post
no.
Just use google....
Quote:
Originally Posted by alpines View Post
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?
12/20/2014 21:59 YatoDev#15
in php you dont need to use ftp on your webspace^^