Re: [PHP] Uploading Files Via PHP
not necesserily both, either of them is enought: drwxrwxrwt2 root root 188416 Mar 27 11:23 /tmp or drwx--2 apache apache 188416 Mar 27 11:23 /var/www/uploads daniel wrote: possibly a permissions problem , dir needs to be 777 and owned by httpd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Uploading Files Via PHP
On Thursday 27 March 2003 18:25, Marek Kilimajer wrote: not necesserily both, either of them is enought: Not quite true :) If owned by 'httpd' then 'httpd' still needs write permission (o+w). drwxrwxrwt2 root root 188416 Mar 27 11:23 /tmp or drwx--2 apache apache 188416 Mar 27 11:23 /var/www/uploads daniel wrote: possibly a permissions problem , dir needs to be 777 and owned by httpd -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* In good speaking, should not the mind of the speaker know the truth of the matter about which he is to speak? -- Plato */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Uploading Files Via PHP
did u even read it ? chmod 777 + owned by httpd -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED] Sent: Thursday, March 27, 2003 9:40 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Uploading Files Via PHP On Thursday 27 March 2003 18:25, Marek Kilimajer wrote: not necesserily both, either of them is enought: Not quite true :) If owned by 'httpd' then 'httpd' still needs write permission (o+w). drwxrwxrwt2 root root 188416 Mar 27 11:23 /tmp or drwx--2 apache apache 188416 Mar 27 11:23 /var/www/uploads daniel wrote: possibly a permissions problem , dir needs to be 777 and owned by httpd -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* In good speaking, should not the mind of the speaker know the truth of the matter about which he is to speak? -- Plato */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Uploading Files Via PHP
By apache I ment the httpd process's user. I don't mean your way won't work, but you give away unnecessary permissions - if the directory is owned by httpd, access rights 700 are enough, if the directory is not owned by httpd, you need at least 007 Dan Rossi wrote: did u even read it ? chmod 777 + owned by httpd -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED] Sent: Thursday, March 27, 2003 9:40 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Uploading Files Via PHP On Thursday 27 March 2003 18:25, Marek Kilimajer wrote: not necesserily both, either of them is enought: Not quite true :) If owned by 'httpd' then 'httpd' still needs write permission (o+w). drwxrwxrwt2 root root 188416 Mar 27 11:23 /tmp or drwx--2 apache apache 188416 Mar 27 11:23 /var/www/uploads daniel wrote: possibly a permissions problem , dir needs to be 777 and owned by httpd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Uploading Files Via PHP
A world writeable directory is a security risk. Why not just fix the owner/group and only give the permissions needed, 775 at most. -Original Message- From: Dan Rossi [mailto:[EMAIL PROTECTED] Sent: Thursday, March 27, 2003 1:45 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] Uploading Files Via PHP did u even read it ? chmod 777 + owned by httpd -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED] Sent: Thursday, March 27, 2003 9:40 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Uploading Files Via PHP On Thursday 27 March 2003 18:25, Marek Kilimajer wrote: not necesserily both, either of them is enought: Not quite true :) If owned by 'httpd' then 'httpd' still needs write permission (o+w). drwxrwxrwt2 root root 188416 Mar 27 11:23 /tmp or drwx--2 apache apache 188416 Mar 27 11:23 /var/www/uploads daniel wrote: possibly a permissions problem , dir needs to be 777 and owned by httpd -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* In good speaking, should not the mind of the speaker know the truth of the matter about which he is to speak? -- Plato */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Uploading Files Via PHP
You could chnage the permissions when you want to write something then change it back when your done. Thats what i do. / Phil - Original Message - From: Jennifer Goodie [EMAIL PROTECTED] To: Dan Rossi [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, March 28, 2003 6:17 AM Subject: RE: [PHP] Uploading Files Via PHP A world writeable directory is a security risk. Why not just fix the owner/group and only give the permissions needed, 775 at most. -Original Message- From: Dan Rossi [mailto:[EMAIL PROTECTED] Sent: Thursday, March 27, 2003 1:45 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] Uploading Files Via PHP did u even read it ? chmod 777 + owned by httpd -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED] Sent: Thursday, March 27, 2003 9:40 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Uploading Files Via PHP On Thursday 27 March 2003 18:25, Marek Kilimajer wrote: not necesserily both, either of them is enought: Not quite true :) If owned by 'httpd' then 'httpd' still needs write permission (o+w). drwxrwxrwt2 root root 188416 Mar 27 11:23 /tmp or drwx--2 apache apache 188416 Mar 27 11:23 /var/www/uploads daniel wrote: possibly a permissions problem , dir needs to be 777 and owned by httpd -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* In good speaking, should not the mind of the speaker know the truth of the matter about which he is to speak? -- Plato */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Uploading Files Via PHP
Or you could just do it correctly the first time and be done with it. :) -Original Message- From: Philip J. Newman [mailto:[EMAIL PROTECTED] Sent: Thursday, March 27, 2003 10:23 AM To: Jennifer Goodie; Dan Rossi; [EMAIL PROTECTED] Subject: Re: [PHP] Uploading Files Via PHP You could chnage the permissions when you want to write something then change it back when your done. Thats what i do. / Phil - Original Message - From: Jennifer Goodie [EMAIL PROTECTED] To: Dan Rossi [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, March 28, 2003 6:17 AM Subject: RE: [PHP] Uploading Files Via PHP A world writeable directory is a security risk. Why not just fix the owner/group and only give the permissions needed, 775 at most. -Original Message- From: Dan Rossi [mailto:[EMAIL PROTECTED] Sent: Thursday, March 27, 2003 1:45 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] Uploading Files Via PHP did u even read it ? chmod 777 + owned by httpd -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED] Sent: Thursday, March 27, 2003 9:40 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Uploading Files Via PHP On Thursday 27 March 2003 18:25, Marek Kilimajer wrote: not necesserily both, either of them is enought: Not quite true :) If owned by 'httpd' then 'httpd' still needs write permission (o+w). drwxrwxrwt2 root root 188416 Mar 27 11:23 /tmp or drwx--2 apache apache 188416 Mar 27 11:23 /var/www/uploads daniel wrote: possibly a permissions problem , dir needs to be 777 and owned by httpd -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* In good speaking, should not the mind of the speaker know the truth of the matter about which he is to speak? -- Plato */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Uploading Files Via PHP
Is there some thing that needs to be turned on in the php.ini in order to be able to upload photos VIA php? I have the same script on one machine with the right permissions on the upload dirs on one machine and am moving to another machine which is not being uploaded. Funny thing is I'm not getting any errors in the Apache logs. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Uploading Files Via PHP
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Are you getting any errors through PHP? Set error reporting to E_ALL then try. ?php error_reporting(E_ALL); ? On Wednesday 26 March 2003 04:41 pm, Vernon wrote: Is there some thing that needs to be turned on in the php.ini in order to be able to upload photos VIA php? I have the same script on one machine with the right permissions on the upload dirs on one machine and am moving to another machine which is not being uploaded. Funny thing is I'm not getting any errors in the Apache logs. Thanks - -- All religions are founded on the fear of the many and the cleverness of the few. - -Stendhal -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE+glMF/rncFku1MdIRAlN5AJ9n6jN4N8dLQg8OVLZZClgSEJ+qEwCffq6f XRmpe/CK1i1ecaHRh7t+eLQ= =snmO -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Uploading Files Via PHP
http://www.php.net/manual/en/features.file-upload.php From the page listed above: Related Configurations Note: See also the file_uploads, upload_max_filesize, upload_tmp_dir, and post_max_size directives in php.ini I would read that manual page as it deals with file uploading support. -Original Message- From: Vernon [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 26, 2003 4:41 PM To: [EMAIL PROTECTED] Subject: [PHP] Uploading Files Via PHP Is there some thing that needs to be turned on in the php.ini in order to be able to upload photos VIA php? I have the same script on one machine with the right permissions on the upload dirs on one machine and am moving to another machine which is not being uploaded. Funny thing is I'm not getting any errors in the Apache logs. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Uploading Files Via PHP
possibly a permissions problem , dir needs to be 777 and owned by httpd = Original Message From Jennifer Goodie [EMAIL PROTECTED] = http://www.php.net/manual/en/features.file-upload.php From the page listed above: Related Configurations Note: See also the file_uploads, upload_max_filesize, upload_tmp_dir, and post_max_size directives in php.ini I would read that manual page as it deals with file uploading support. -Original Message- From: Vernon [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 26, 2003 4:41 PM To: [EMAIL PROTECTED] Subject: [PHP] Uploading Files Via PHP Is there some thing that needs to be turned on in the php.ini in order to be able to upload photos VIA php? I have the same script on one machine with the right permissions on the upload dirs on one machine and am moving to another machine which is not being uploaded. Funny thing is I'm not getting any errors in the Apache logs. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Uploading Files through PHP
I'm trying to let users upload word files through a PHP form but its not working! The script keeps telling me that the file path doesn't exist. HERE'S THE CODE I USE IN THE FORM PAGE: FORM ENCTYPE=multipart/form-data ACTION=freelancers/uploaded_word.php METHOD=POST INPUT TYPE=hidden name=MAX_FILE_SIZE value=1000 p align=center input type=submit value=Upload name=submit input type=file name=wordcv size=30 /p /form is the code on the form page, when i submit i'm told the $wordcv is a null. WHY?? -- Regards, Georgie Casey [EMAIL PROTECTED] *** http://www.filmfind.tv Ireland's Online Film Production Directory *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Uploading Files with PHP
Hi, I am trying to set a small script that would let my clients upload file with a Explorer or Netscape, but the problem is it would let me upload any file that is great than a 1MB. We get an error that the file none could not be read. I have set the upload_tmp_dir=/tempupload is has been chmod to 777, php.ini as been set to 20MB, I know that is a lot but we are engingeering company that work with CADD files. Any clues where to look? The PHP 4 Bible from IDG states that we have to under HTTP uploads, but nothing else. Is there some where on the net that explains better what I have to set up, turn on, or haven't done? Thanks, Chuck -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Uploading Files via PHP
I've been using a PHP upload script to upload files to our server, but my problem is this. I can't upload anything but JPG, GIF, and HTML files. Anyone have any idea why? This is probably something simple that I'm just overlooking, but please help. Brian Drexler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Uploading Files via PHP
The script you are using is probably checking the MIME type of the file uploaded and rejecting any of the ones that are not one of the types you listed. Look at or post some of the code you are using to find out if this is the case. Michael Brian Drexler wrote: I've been using a PHP upload script to upload files to our server, but my problem is this. I can't upload anything but JPG, GIF, and HTML files. Anyone have any idea why? This is probably something simple that I'm just overlooking, but please help. Brian Drexler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Uploading Files via PHP
? exec( "mv $image '$Destination/$FileName'"); ? - Original Message - From: Michael Stearne [EMAIL PROTECTED] To: Brian Drexler [EMAIL PROTECTED] Cc: Php-General [EMAIL PROTECTED] Sent: Sunday, February 18, 2001 1:55 PM Subject: Re: [PHP] Uploading Files via PHP The script you are using is probably checking the MIME type of the file uploaded and rejecting any of the ones that are not one of the types you listed. Look at or post some of the code you are using to find out if this is the case. Michael Brian Drexler wrote: I've been using a PHP upload script to upload files to our server, but my problem is this. I can't upload anything but JPG, GIF, and HTML files. Anyone have any idea why? This is probably something simple that I'm just overlooking, but please help. Brian Drexler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Uploading Files via PHP
Hmm. I don't know one thing you could try is putting $image in quotes, like '$image'. Also you might try to use the code I have pasted below. Using exec is probably not the most effecient way to do the copy of the file (and using mv limits you to *nix). Make sure you remove the checks for image type files that I make in the checkImgType() function. HTH, Michael if($Image!="none"){ $ImageExt=checkImgType($Image_type,$Image_name); } if($Image!="none"){ $ImageFinal=$ABS_PRODUCTS_IMAGES_DIR.$LastInsertID."Image".$ImageExt; copy($Image, $ImageFinal); } function checkImgType($image_type,$image_name){ if((strcmp($image_type,"image/jpeg")==0)||(strcmp($image_type,"image/gif")==0)||(strcmp($image_type,"image/pjpeg")==0)||(strcmp($image_type,"image/jpg")==0)) { switch($image_type){ case "image/jpg": $imageExt=".jpg"; break; case "image/jpeg": $imageExt=".jpg"; break; case "image/pjpeg": $imageExt=".jpg"; break; case "image/gif": $imageExt=".gif"; break; } return $imageExt; }else { print "bfont color=red$image_name is not a valid file to upload.br Please upload JPEG (.jpg) or GIF (.gif) type images only./font/bbrnbsp;br"; return 0; } } Brian Drexler wrote: ? exec( "mv $image '$Destination/$FileName'"); ? - Original Message - From: Michael Stearne [EMAIL PROTECTED] To: Brian Drexler [EMAIL PROTECTED] Cc: Php-General [EMAIL PROTECTED] Sent: Sunday, February 18, 2001 1:55 PM Subject: Re: [PHP] Uploading Files via PHP The script you are using is probably checking the MIME type of the file uploaded and rejecting any of the ones that are not one of the types you listed. Look at or post some of the code you are using to find out if this is the case. Michael Brian Drexler wrote: I've been using a PHP upload script to upload files to our server, but my problem is this. I can't upload anything but JPG, GIF, and HTML files. Anyone have any idea why? This is probably something simple that I'm just overlooking, but please help. Brian Drexler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] uploading files through php-generated scripts
Richard Lynch wrote: I've got a strange thing with overriding an ini file in PHP. I'm trying to implement a simple example of a script that allows a file to be uploaded. I put an INPUT TYPE="file" NAME="myfile" ENCTYPE="multipart/form-data" tag ENCTYPE goes in the FORM tag, I think... maybe, but this is copied straight out of a PHP book I've got by Judy Meloni on the form, along with a submit button. (yeah, the rest of the HTML is fine...) The script gets the file, uploads it, and the $myfile variable says the uploaded file is named something like "/var/tmp/phpq32345". However, I don't have write permissions to /var/tmp. (Neither does the process doing the actual upload!) What process is it that you think is doing the upload?... PHP scripts run as user nobody on this system It's usually "nobody" who owns it, which usually does have write access to /tmp files. Or, maybe in your OS, /var/tmp files. If PHP says it got it there, it probably did. PHP gives me a file name like what I showed above, but it's not there by the time the script tries to copy it. We're not talking a huge script here -- an exec( "ls -l $myfile" ) doesn't find the file. If it was ever there, it's gone almost instantaneously. But then you must copy it or process it, because PHP will delete it when the script ends -- to avoid a denial-of-service attack where somebody tries to upload a million little files through your web-server to fill up /tmp. I created a php3.ini file in the same directory that contains the script. It has only the line: upload_tmp_dir = myuploads Then I created a directory named myuploads in the same dir with 2777 perms. However, the script never sees this ini file! I printed out the cwd from the script, and it IS the same dir where the php3.ini file resides; I can even exec a command 'ls -l *.ini' and it shows up there just fine. You can't do that in a php.ini file in the same directory. You *can* do it (maybe) with an .htaccess file, if Apache has .htaccess turned on in httpd.conf, and upload_tmp_dir isn't one of the non-over-ridable directives. The things I've read say the php3.ini file goes in the "current directory". I'm not sure which one that is, but it's obviously not the one containing the script files. Any other ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]