upload problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Milan
Forum Commoner
Posts: 97
Joined: Wed May 17, 2006 6:08 pm

upload problem

Post by Milan »

I have the following code:

Code: Select all

copy($_FILES["filename"]["tmp_name"],"./".$_FILES["filename"]["name"]) or die("<b>Unknown error!</b>");
but it wont upload my image, i always get "Unknown error", i do have read/write access, path is ok and input type is "file"

Does anyone know another good way to upload a file?

thanks!
User avatar
tecktalkcm0391
DevNet Resident
Posts: 1030
Joined: Fri May 26, 2006 9:25 am
Location: Florida

Post by tecktalkcm0391 »

yes i think the path that your storing the files needs to be able to read/write by everyone inorder for this to wokr
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

There is also the function move_uploaded_file() specifically for this.
(#10850)
Milan
Forum Commoner
Posts: 97
Joined: Wed May 17, 2006 6:08 pm

Post by Milan »

I know i am a pain in the ass, but gave you give me an example with it?
User avatar
PrObLeM
Forum Contributor
Posts: 418
Joined: Sun Mar 07, 2004 2:30 pm
Location: Mesa, AZ
Contact:

Post by PrObLeM »

Milan wrote:I know i am a pain in the ass, but gave you give me an example with it?
did you look at the User Contributed Notes on the manual, heck even google it?
Milan
Forum Commoner
Posts: 97
Joined: Wed May 17, 2006 6:08 pm

Post by Milan »

Yes, and i still have the same probem,

i have tried over 15 methods so far.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

What's the lastest code you've tried?

Mac
Post Reply