Kamala Harris - Valentine Gifts - Internet Advertising - Debt Consolidation - Find jobs

PDA

View Full Version : File Uploading


ResaleBroker
Jul 12th 2004, 1:02 pm
I would like to allow clients to upload digital photos [files] of their home so that I can place them on my website.

On many sites there is a "file upload" function with a browse feature that allows you to look for files on your local computer.

What is involved in setting this up?

digitalpoint
Jul 12th 2004, 1:47 pm
I would like to allow clients to upload digital photos [files] of their home so that I can place them on my website.

On many sites there is a "file upload" function with a browse feature that allows you to look for files on your local computer.

What is involved in setting this up?

What server-side scripting languages are available on the server? PHP, ASP, etc.?

TwisterMc
Jul 12th 2004, 2:39 pm
If you have PHP it's easy. Just let us know if you need help.

http://us2.php.net/manual/en/features.file-upload.php

ResaleBroker
Jul 12th 2004, 2:41 pm
I'm on a Linux server and the only available server-side scripting language are PHP, CGI, and Pearl.

ResaleBroker
Jul 12th 2004, 3:02 pm
WOW! :eek: You wouldn't happen to know of a "For Dummies" paper on that would you?

ResaleBroker
Jul 12th 2004, 10:46 pm
If you have PHP it's easy. Just let us know if you need help.

http://us2.php.net/manual/en/features.file-upload.php

Ok, the form was easy but I'm at a loss about the contents of the PHP file. Help?

TwisterMc
Jul 13th 2004, 7:13 am
Ok this is what i do in my php file....

$name = $_FILES['uploadfilename']['name'];

if (is_uploaded_file($_FILES['uploadfilename']['tmp_name'])) {
copy ($_FILES['uploadfilename']['tmp_name'], "www/upload/files/".$_FILES['uploadfilename']['name']);

Note: In my form my file field has a name of uploadfilename

Does that help any?

ResaleBroker
Jul 13th 2004, 11:50 am
Please look at the sequence below and tell me what steps are missing.

1.) I created a form:

<form enctype="multipart/form-data" action="http://www.resalebroker.com/uploadfilename.php" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Send File" />
</form>

2.) I created a PHP file named "uploadfilename.php"

Contents:

$name = $_FILES['uploadfilename']['name'];

if (is_uploaded_file($_FILES['uploadfilename']['tmp_name'])) {
copy ($_FILES['uploadfilename']['tmp_name'], "www/upload/files/".$_FILES['uploadfilename']['name']);

I appreciate the help. :)

TwisterMc
Jul 13th 2004, 12:27 pm
First off, your if statement needs to be closed with a } ;)

Second, in the php file you need to change uploadfilename to userfile as your field name is different than mine was.

Are you getting errors? Do you have a site up we could see? I always helps :)

ResaleBroker
Aug 4th 2004, 4:58 pm
Sorry it took so long to get back. I finally figured it out. Thanks for the support.