iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-25-2004, 09:36 AM
somjai's Avatar
WebProWorld Member
 
Join Date: Jan 2004
Location: Phuket, Thailand
Posts: 52
somjai RepRank 1
Default uploading files with php problem

Hi
I was hoping someone might help me with this problem. I have a page with a file upload option, but when you try to upload a file you get this

Warning: copy(/home/saltwat/public_html/images/headerbanner.jpg): failed to open stream: Permission denied in /home/saltwat/public_html/forms/formmail.php on line 362

Warning: Cannot modify header information - headers already sent by (output started at /home/saltwat/public_html/forms/formmail.php:362) in /home/saltwat/public_html/forms/formmail.php on line 411

I would really appreciate some help or suggestions
Thank you
kind regards
Somjai
Reply With Quote
  #2 (permalink)  
Old 10-25-2004, 03:38 PM
mushroom's Avatar
WebProWorld Pro
 
Join Date: Feb 2004
Location: Queen Charlotte B. C. Canada
Posts: 287
mushroom RepRank 0
Default

Quote:
Warning: copy(/home/saltwat/public_html/images/headerbanner.jpg): failed to open stream: Permission denied in /home/saltwat/public_html/forms/formmail.php on line 362
Permissions in /home/saltwat/public_html/images/ are not set correctly, they need to be set to "777" or "xrw xrw xrw", so that php can write to the directory.
Quote:
Warning: Cannot modify header information - headers already sent by (output started at /home/saltwat/public_html/forms/formmail.php:362) in /home/saltwat/public_html/forms/formmail.php on line 411
Only means that the first error happened before your headers where sent.
__________________
Irony: That for most people the most "trusted" web site on the planet is for a company the has been convicted of criminal activity.

Both Security and SuSe start with "S". www.oldslides.com
Reply With Quote
  #3 (permalink)  
Old 10-25-2004, 08:07 PM
WebProWorld Pro
 
Join Date: May 2004
Location: Austin, TX
Posts: 199
steve0 RepRank 0
Default

Make sure the owner of the file also has ownership of the target directory.. i.e. "apache" or "nobody"
Usually the process the webserver is running as..

e.g.
-rw------- 1 apache apache 1816 Oct 31 23:59 uploadimage.php

drwx------ 2 apache admin 4096 Oct 31 12:00 filetargetdirectory


Also .. 777 BAAAAD .. that means the directory is readable, writeable and EXECUTABLE by everyone..

You can get by with 755


Regarding the header.. there should be nothing written to the screen i.e. no output.. echo, printf etc.. before the header(); setcookie() or other similar call..
__________________
Hardcore Programming Solutions and Coffee Drinker
Reply With Quote
  #4 (permalink)  
Old 11-13-2004, 02:08 AM
somjai's Avatar
WebProWorld Member
 
Join Date: Jan 2004
Location: Phuket, Thailand
Posts: 52
somjai RepRank 1
Default Thank you

Thank you for your answers
I haven't fixed the problem yet though
have taken the page off until I can work it out

Thanks again
Somjai
Reply With Quote
  #5 (permalink)  
Old 11-13-2004, 05:18 PM
WebProWorld Member
 
Join Date: Oct 2004
Posts: 60
Claud RepRank 0
Default

I would like to ask something too regarding php and the upload page. I also have an upload page set up but I can't upload more than 20 Mb. I know that I have to modify something on the files on the server to have permission for more, but I'm not sure exactly what are the changes I have to make. Anyone can help me? Thank you in advance.
Reply With Quote
  #6 (permalink)  
Old 11-13-2004, 05:59 PM
Easywebdev's Avatar
WebProWorld Veteran
 
Join Date: Apr 2004
Posts: 310
Easywebdev RepRank 1
Default

You need to alter the upload_max_filesize in your php.ini file.

If you have access to your server files and can edit them then edit the upload_max_filesize to whatever size you think you need.

To find out where the file is you can type the command
locate php.ini
and it will show you where it is.
__________________
"I have not failed. I have found 10,000 ways that don't work" - Thomas Edison.
"The secret to creativity is knowing how to hide your sources" - Albert Einstein.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum

Thread Tools
Display Modes

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



All times are GMT -4. The time now is 12:12 PM.



Search Engine Optimization by vBSEO 3.3.0