|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
FTP upload script
I wrote this FTP script to upload files to my server. it works perfectly, but when I try to upload larger images 10k and above, it won't upload them. Why?
Here's my script: ----------------------------------------------------------- $filec = "C:\blah.txt"; $uname = "username"; $pass = "********"; $remote = "/test/$filec"; $ftpc = ftp_connect('ftp.nakedsexy.us'); if (ftp_login($ftpc, $uname, $pass)) { print ("FTP logged in...<br />\n"); } else { print ("FTP could not login.<br />\n"); } if (ftp_put($ftpc, $remote, $filec, FTP_BINARY)) { print ("File was uploaded.<br />\n"); } else { print ("File was not uploaded.<br />\n"); } ftp_close($ftpc); ----------------------------------------------------------- Can someone help me with it, tell me what I have to add to make it be able to upload files up to 90 kilobytes? I need to get it so it can upload files from 0 kilobytes to 90 kilobytes. I don't have any idea why it won't upload files larger than 5-10 kb. I need help. |
|
#2
|
|||
|
|||
|
Try setting $post_max_size="10000000"; or whatever value you like
__________________
Ian Jamieson - www.urbantricking.com |
|
#3
|
|||
|
|||
|
?
Where does that variable come from? Where's it get used? I don't know where to put it in my script.
|
|
#4
|
||||
|
||||
|
Its in the php.ini
__________________
Linux Apache Mysql PHP - http://fedora.redhat.com/ |
|
#5
|
|||
|
|||
|
Do I set it as:
$post_max_size="10000000"; or as: post_max_size="10000000"; ? What part of the ftp script I wrote do I put it in? Do I put it here: ----------------------------------------------------------- $filec = "C:\blah.txt"; $uname = "username"; $pass = "********"; $remote = "/test/$filec"; $ftpc = ftp_connect('ftp.nakedsexy.us'); if (ftp_login($ftpc, $uname, $pass)) { $post_max_size="10000000"; print ("FTP logged in...<br />\n"); } else { print ("FTP could not login.<br />\n"); } if (ftp_put($ftpc, $remote, $filec, FTP_BINARY)) { print ("File was uploaded.<br />\n"); } else { print ("File was not uploaded.<br />\n"); } ftp_close($ftpc); ----------------------------------------------------------- ? |
|
#6
|
|||
|
|||
|
I think you need to read a lot of the FM or at least read the comments in the php.ini file.
__________________
A lean and mean secure FTP applet with GUI. Just 150 kb in size http://www.radinks.com/sftp |
|
#7
|
|||
|
|||
|
I will
Right now I'm just trying to find out how to make my ftp upload script able to upload a larger file than it's able to now. That script works fine, but only with small files.
|
|
#8
|
|||
|
|||
|
Hi!
I'm about make an FTP upload for my customers on our website. So that they can go into our website and upload files to our ftp-server. How can I use this script and make the customers browse their local machine and upload files to me? I want the $filec you specified to be the file that they choose from their local disk. Any ideas? Im sort of a newbie ![]() Thanx. KLM |
|
#9
|
||||
|
||||
|
personally id use a <input type="file" name="file2b_ftpd"> to post the file to the script
|
|
#10
|
||||
|
||||
|
If you put this in the same form with your file input control, I think it'll do the trick.
<input type="hidden" name="MAX_FILE_SIZE" value="1000000"> |
![]() |
| Viewing: Dev Shed Forums > System Administration > FTP Help > FTP upload script |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|