[Twisted-Python] Upload large files on twisted server

Tux Attack tuxattack14 at gmail.com
Wed Apr 14 05:23:46 EDT 2010


Hi,

I need some help in uploading large files to twisted server.
I want to upload large files on twisted server using php.But as php has
limit of 24MB, I decided to use ftp functions of php to upload large files.I
am running ftp server written in twisted.When i try to upload a file using
any ftp client then its working fine but when i use a php script for ftp
file upload then it is not working.Initially when i tried to upload file
using same php script but without passive mode , it created a file on server
but the size of file was 0 bytes.When i added a line to switch to passive
mode now it doesn't go beyond a function to switch passive mode and
connection to server gets timed out.Here is my php code



<?php
> $ftp_server='localhost';
> $ftp_user_name='chetan';
> $ftp_user_pass='chetan';
> $file = 'av.jpg';
> $remote_file = 'av.jpg';
>
> $conn_id = ftp_connect($ftp_server, 8002);
>
> $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
>
> ftp_pasv($conn_id, true);
>
> if (ftp_put($conn_id, $remote_file, $file, FTP_BINARY)) {
>  echo "successfully uploaded $file\n";
> } else {
>  echo "There was a problem while uploading $file\n";
> }
>
> ftp_close($conn_id);
> ?>
>
>
 Or is there any other way i can upload large files on twisted server ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20100414/06ff0a50/attachment.htm 


More information about the Twisted-Python mailing list