|
You last visited: Today at 22:14
Advertisement
uploading file without ftp ?
Discussion on uploading file without ftp ? within the AutoIt forum part of the Coders Den category.
12/17/2014, 19:18
|
#1
|
elite*gold: 0
Join Date: Feb 2009
Posts: 1,234
Received Thanks: 1,095
|
uploading file without ftp ?
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
|
#2
|
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
|
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
|
#3
|
elite*gold: 0
Join Date: Feb 2009
Posts: 1,137
Received Thanks: 573
|
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
|
#4
|
elite*gold: 0
Join Date: Feb 2009
Posts: 1,234
Received Thanks: 1,095
|
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
|
#5
|
elite*gold: 0
Join Date: Jan 2013
Posts: 426
Received Thanks: 129
|
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
|
#6
|
elite*gold: 0
Join Date: Feb 2009
Posts: 1,234
Received Thanks: 1,095
|
Quote:
Originally Posted by FacePalmMan
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
|
#7
|
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
|
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
|
#8
|
elite*gold: 0
Join Date: Feb 2010
Posts: 270
Received Thanks: 912
|
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
|
#9
|
elite*gold: 0
Join Date: Feb 2009
Posts: 1,234
Received Thanks: 1,095
|
Quote:
Originally Posted by alpines
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.
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
|
#10
|
elite*gold: 50
Join Date: Sep 2012
Posts: 3,841
Received Thanks: 1,462
|
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
|
#11
|
elite*gold: 0
Join Date: Feb 2009
Posts: 1,234
Received Thanks: 1,095
|
Quote:
Originally Posted by »FlutterShy™
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
|
#12
|
elite*gold: 50
Join Date: Sep 2012
Posts: 3,841
Received Thanks: 1,462
|
Quote:
Originally Posted by fear-x
but a php connection can get overloaded and crash ?
|
no.
Just use google....
|
|
|
12/20/2014, 19:49
|
#13
|
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
|
Quote:
Originally Posted by fear-x
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
|
#14
|
elite*gold: 0
Join Date: Feb 2009
Posts: 1,234
Received Thanks: 1,095
|
Quote:
Originally Posted by »FlutterShy™
no.
Just use google....
|
Quote:
Originally Posted by alpines
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
|
#15
|
elite*gold: 50
Join Date: Sep 2012
Posts: 3,841
Received Thanks: 1,462
|
in php you dont need to use ftp on your webspace^^
|
|
|
All times are GMT +1. The time now is 22:16.
|
|