Helpful Information
 
 
Category: System Administration
ftp?!

I want to fopen a local file with php program in server.
The file name is transferred through a form
...< input type="file" name="filename"...
I write the php code like this
fopen($filename,"r");
But I cant reach to my expected result.

So I should use ftp? first, ftp the file form local disk to server, then in server fopen the file. ...
( and can i implement it? )

To debug it put some print statements in place:

print("File Path: $filename<br>n");
print("File Name: $filename_name<br>n");
print("File Type: $filename_type<br>n");
print("File Size: $filename_size<br>");

That way you know if the file is being uploaded properly. There's other things I don't know if your doing. Put hidden input type called MAX_FILE_SIZE
<input type="hidden" name="MAX_FILE_SIZE" value="2048000"> for 2 meg max. Don't go over 2 meg.
before the <input "file" ....
Also in the form statement do you have ENCTYPE="multipart/form-data" and POST only not GET.
If your doing all this it should work.

Thank u lhallusa.
I'm a new man of PHP.
So an detailed demo(including some source code) would be important for me.

ftp functions must be used in PHP4, right?
Can u tell me how to setup ftp lib in RedHat + Apache.

Why does it give an error "Fatal error: Call to unsupported or undefined function ftp_connect()"?
You failed to compile PHP with the FTP functions. You need PHP 3.0.13 or higher, and you must configure it with the --with-ftp flag. Go to the PHP web site for help with that.

Found this at: http://www.inebria.com/phpftp/

hope that helps. The source code is there also which has PHP ftp functions using the phpftp extension.


------------------
lhallusa
webpatron.com (http://www.webpatron.com)










privacy (GDPR)