Computing.Net > Forums > Web Development > PHP Form + FTP upload

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

PHP Form + FTP upload

Reply to Message Icon

Name: kyleinc
Date: January 16, 2005 at 17:18:21 Pacific
OS: FreeBSD
CPU/Ram: ?
Comment:

I am trying to write a form for a user to upload a file to a directory on my web server. I am connecting correctly and I can run other FTP commands, such as rename, but I am unable to upload. What can be the problem? My code is at http://www.spanimmersion.org/upload.txt



Sponsored Link
Ads by Google

Response Number 1
Name: Khalid
Date: January 16, 2005 at 23:27:55 Pacific
Reply:

If I look at the code, I have the idea something is missing, ie. the $submit-variable, I dont see where it is created but it is used in the beginning to determine the flow.

Same for $source_file, I do see you have named the form-element 'source-file', but that doesnt mean the file 'gets' into that variabele on his own...
$sourcefile = $_FILES['source_file']['tmp_name']
because file-uploads end up in the array $_FILES

Perhaps you should read [url]http://www.php.net/manual/en/features.file-upload.php[/url] first because I also miss the encoding type for the form because you are uploading a file:
(form method="POST" action="<?php echo $PHP_SELF?>" enctype="multipart/form-data")

good luck!


0

Response Number 2
Name: cubesoft
Date: January 17, 2005 at 07:36:18 Pacific
Reply:

You miss the multipart/form-data.

<form method="POST" action="<?php echo $PHP_SELF?>" enctype="multipart/form-data">


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: PHP Form + FTP upload

php form www.computing.net/answers/webdevel/php-form/762.html

PHP form progess bar? www.computing.net/answers/webdevel/php-form-progess-bar/3376.html

PHP Form www.computing.net/answers/webdevel/php-form/2146.html