Re: [PHP] how to manage permissions for file uploader
> But, if I move the directory a level up, not accessable from outside - how > can read the image since it's not accessable fro outside? I can't > inlcude() the image? You need to do something simmaler to reading files stored in a database, which is described here: http://www.php-mysql-tutorial.com/wikis/mysql-tutorials/uploading-files-to-mysql-database.aspx bit instead of reading the data from the DB, read if from the file using fopen() and fread(). you may need to read the file in chunks to prevent running out of RAM, depending on how big the spasific file is. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to manage permissions for file uploader
From: Phpster To: Lamp Lists Cc: "php-general@lists.php.net" Sent: Wednesday, June 3, 2009 8:30:05 PM Subject: Re: [PHP] how to manage permissions for file uploader This is fairly simple to do as an http upload. With the folder above the web root, it less if an issue since general users can't gain access, a script can do all the interaction needed. Plus you can chown the permissions with php Bastien Sent from my iPod On Jun 3, 2009, at 17:24, Lamp Lists wrote: > to upload an image for a photo gallery (my own code) I have to have > permission for the directory images 0777. > but having permission for a directory 0777 is REALLY bad idea, isn't it? > I'm "owner" of the directory (lamp:lamp images). > > what to do to set my code has permission to upload an image into the images > directory and have permissions on the directory 0755? > > I googled for file uploader scripts and classes to se how they handle it but > I can't see that part. just file/size/type validation and moving uploaded > file to final destination. > > thanks. > > -LL > > > --PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php But, if I move the directory a level up, not accessable from outside - how can read the image since it's not accessable fro outside? I can't inlcude() the image?
Re: [PHP] how to manage permissions for file uploader
From: Phpster To: Lamp Lists Cc: "php-general@lists.php.net" Sent: Wednesday, June 3, 2009 8:30:05 PM Subject: Re: [PHP] how to manage permissions for file uploader This is fairly simple to do as an http upload. With the folder above the web root, it less if an issue since general users can't gain access, a script can do all the interaction needed. Plus you can chown the permissions with php Bastien Sent from my iPod On Jun 3, 2009, at 17:24, Lamp Lists wrote: > to upload an image for a photo gallery (my own code) I have to have > permission for the directory images 0777. > but having permission for a directory 0777 is REALLY bad idea, isn't it? > I'm "owner" of the directory (lamp:lamp images). > > what to do to set my code has permission to upload an image into the images > directory and have permissions on the directory 0755? > > I googled for file uploader scripts and classes to se how they handle it but > I can't see that part. just file/size/type validation and moving uploaded > file to final destination. > > thanks. > > -LL > > > Right. I did it for very first time. Now, I changed the hosting and directory is already full with images. What now? Create by php new one and then move by php images to new folder?
Re: [PHP] how to manage permissions for file uploader
This is fairly simple to do as an http upload. With the folder above the web root, it less if an issue since general users can't gain access, a script can do all the interaction needed. Plus you can chown the permissions with php Bastien Sent from my iPod On Jun 3, 2009, at 17:24, Lamp Lists wrote: to upload an image for a photo gallery (my own code) I have to have permission for the directory images 0777. but having permission for a directory 0777 is REALLY bad idea, isn't it? I'm "owner" of the directory (lamp:lamp images). what to do to set my code has permission to upload an image into the images directory and have permissions on the directory 0755? I googled for file uploader scripts and classes to se how they handle it but I can't see that part. just file/size/type validation and moving uploaded file to final destination. thanks. -LL -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how to manage permissions for file uploader
to upload an image for a photo gallery (my own code) I have to have permission for the directory images 0777. but having permission for a directory 0777 is REALLY bad idea, isn't it? I'm "owner" of the directory (lamp:lamp images). what to do to set my code has permission to upload an image into the images directory and have permissions on the directory 0755? I googled for file uploader scripts and classes to se how they handle it but I can't see that part. just file/size/type validation and moving uploaded file to final destination. thanks. -LL