Image not uploading

This is a discussion on "Image not uploading" within the PHP Forum section. This forum, and the thread "Image not uploading are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Mar 10th, 2006, 16:15
Reputable Member
Join Date: Nov 2005
Posts: 127
Thanks: 0
Thanked 0 Times in 0 Posts
Image not uploading

Can anyone spot anything here that might be causing the problem, it creates a new subdirectory, gives it the name and sets permissions to 777 so I know that parts ok. I think it must be something here. Im uploading 4 images at the same time so I have it in a loop. Its getting the correct names as ive tried printing $_FILES["$filename"]['name'] and it gives the original name of the file im trying to upload. The path is also correct but i get 'Could not upload', is there something ive missed?

PHP: Select all

copy ($_FILES["$filename"]['tmp_name'], "/home/deano/public_html/Images/$advertid/".$_FILES["$filename"]['name']) or die ('Could not upload'); 

Reply With Quote

  #2 (permalink)  
Old Mar 20th, 2006, 23:02
Up'n'Coming Member
Join Date: Feb 2006
Location: London
Age: 25
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Image not uploading

Hi djme,
I assume your uploading via a form???

do you have enctype="multipart/form-data" in your form tag??? eg...
<form enctype="multipart/form-data" action="admin_add_product.php" method="post">

I resolved a similar issue by adding enctype.

The only other thing I could think of is that you don't have permissions set to upload files in your php.ini file, or you have a limit on the file size, it's usually 2Mb...

; Whether to allow HTTP file uploads.
file_uploads = On

Hope this helps.
Jim.
Reply With Quote
  #3 (permalink)  
Old Mar 21st, 2006, 10:45
Reputable Member
Join Date: Nov 2005
Posts: 127
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Image not uploading

Hi, thanks but ive sorted it now. I can't remember what I did but I think id got the path wrong.

Don't suppose you know how to delete directories? I have subdirectories which I want to delete (they contain pictures). The pictures are set to 644 but the directroies are 777 so I thought I could just delete the entire directory using

unlink($delete_path);

But when i try it, it says warning $delete_path is a directory and doesn't do it. I can delete individual images using it though. Does this just work for files and not directories or do I need to have the images also set to 777 (I didn't think I would because it deletes the images set at 644 since they are in the directory set at 777)

Thanks
Reply With Quote
Reply

Tags
image, uploading

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Uploading various image files Paula ASP.NET Forum 1 Oct 7th, 2006 20:39
uploading a .mov ppgpilot PHP Forum 2 Jul 26th, 2006 07:01
image uploading HELP Gavy Graphics and 3D 5 Jun 24th, 2006 10:23
Uploading ClaireB Hosting & Domains 10 Sep 8th, 2005 12:06
uploading benbacardi Classic ASP 4 Nov 4th, 2004 17:11


All times are GMT. The time now is 02:18.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43