Re: [PHP-DB] Re: blob
On Wed, 2003-01-08 at 06:50, [EMAIL PROTECTED] wrote: > > i know this is a bit down the chain, but i'm trying to keep the message > strings in tact > > but can't you set up your directory just like you set up your mysql Grants. > I have a directory that the web user owns, who is in its own group. so i > set the permisssions once, and its done. Also i don't store the folder > structure, i have a variable named for that folder structure then if the > folders move or you need to move your webservers, the path will dynamically > update, regardless of location. Here's the problem. You have two choices for permissions with uploads: 1. You can make the upload directory world-writable. This is a major security risk, as any other user on the system can write to it as well. 2. You can make the upload directory owned by the apache user (or whatever user your web-server runs as). This is a problem because you have to be root in order to make the change. Many users don't have this option. Uploading the file to a DB solves both of these problems. It presents its own problems too, though. Downloads of the binary data are slow. And it's difficult to get a user's browser to cache the dynamic pages. For example: Mozilla will cache a URL that looks like this: http://example.com/image.jpg, but it has trouble caching a URL like this: http://example.com/image.php?id=3. Does anyone know the right headers to send to get browsers to cache these dynamic image pages as if they were static images? --Dave -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: blob
i know this is a bit down the chain, but i'm trying to keep the message strings in tact but can't you set up your directory just like you set up your mysql Grants. I have a directory that the web user owns, who is in its own group. so i set the permisssions once, and its done. Also i don't store the folder structure, i have a variable named for that folder structure then if the folders move or you need to move your webservers, the path will dynamically update, regardless of location. just some thoughts, this is a topic that intrigues me, jeff "Bayu Susiloadhy" To: [EMAIL PROTECTED] <[EMAIL PROTECTED] cc: id> Subject: [PHP-DB] Re: blob 01/08/2003 03:40 AM it's very useful to store images in the db then in the other page show the image by selecting it then print it out to the page with "Content-type: image" (jpeg/gif/etc) header; But, i didn't find how to show pdf binary file so that the browser can directly call acrobat reader to show it, i tried to use content-type : application/pdf but it failed! i think maybe in the pdf cases, browser called acrobat reader because of its extension (pdf),not because the header is it true? could someone help me? Luke Woollard writes: > I agree with Dave. I wrote an application to allow a client to upload/manage > images and categorise them into diff. parts of their website. > > Images were stored as normal image files after upload and a pointer made to > them from the appropriate database record (which had additional image info > e.g. description) > > Since I now have to move this website to a new server -> transferring all > these files was a bit annoying. Storing them as binary data in mysql would > have been easier to manage... > > > > > > > -Original Message- > From: David Smith [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 8 January 2003 10:19 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP-DB] Re: blob > > > On Tue, 2003-01-07 at 15:52, [EMAIL PROTECTED] wrote: >> >> I agree with this method. i have not yet seen an advantage of storing >> blobs in a database. Is there one? i'm sure those on this list would > have >> an opinion if there was one. personally, i like storing all this stuff on >> the file system. > > There is one advantage. You must either chown the upload directory to > the user that your web-server runs as, or chmod it to be world-writable. > When creating a web-application that you plan to distribute (like > Slashcode), you can't assume that your users will have that privilege. > So, storing it in MySQL is a great option. > > --Dave > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > &$BS -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: blob
it's very useful to store images in the db then in the other page show the image by selecting it then print it out to the page with "Content-type: image" (jpeg/gif/etc) header; But, i didn't find how to show pdf binary file so that the browser can directly call acrobat reader to show it, i tried to use content-type : application/pdf but it failed! i think maybe in the pdf cases, browser called acrobat reader because of its extension (pdf),not because the header is it true? could someone help me? Luke Woollard writes: I agree with Dave. I wrote an application to allow a client to upload/manage images and categorise them into diff. parts of their website. Images were stored as normal image files after upload and a pointer made to them from the appropriate database record (which had additional image info e.g. description) Since I now have to move this website to a new server -> transferring all these files was a bit annoying. Storing them as binary data in mysql would have been easier to manage... -Original Message- From: David Smith [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 8 January 2003 10:19 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Re: blob On Tue, 2003-01-07 at 15:52, [EMAIL PROTECTED] wrote: I agree with this method. i have not yet seen an advantage of storing blobs in a database. Is there one? i'm sure those on this list would have an opinion if there was one. personally, i like storing all this stuff on the file system. There is one advantage. You must either chown the upload directory to the user that your web-server runs as, or chmod it to be world-writable. When creating a web-application that you plan to distribute (like Slashcode), you can't assume that your users will have that privilege. So, storing it in MySQL is a great option. --Dave -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php &$BS -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Re: blob
I agree with Dave. I wrote an application to allow a client to upload/manage images and categorise them into diff. parts of their website. Images were stored as normal image files after upload and a pointer made to them from the appropriate database record (which had additional image info e.g. description) Since I now have to move this website to a new server -> transferring all these files was a bit annoying. Storing them as binary data in mysql would have been easier to manage... -Original Message- From: David Smith [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 8 January 2003 10:19 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Re: blob On Tue, 2003-01-07 at 15:52, [EMAIL PROTECTED] wrote: > > I agree with this method. i have not yet seen an advantage of storing > blobs in a database. Is there one? i'm sure those on this list would have > an opinion if there was one. personally, i like storing all this stuff on > the file system. There is one advantage. You must either chown the upload directory to the user that your web-server runs as, or chmod it to be world-writable. When creating a web-application that you plan to distribute (like Slashcode), you can't assume that your users will have that privilege. So, storing it in MySQL is a great option. --Dave -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: blob
I agree with this method. i have not yet seen an advantage of storing blobs in a database. Is there one? i'm sure those on this list would have an opinion if there was one. personally, i like storing all this stuff on the file system. Jeff "Alex Francis" cc: Subject: [PHP-DB] Re: blob 01/07/2003 05:18 PM Please respond to "Alex Francis" Why not upload the PDF file to a files directory and just put the path and filename in your database. "Natividad Castro" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi to all, > I want to be able to load PDFs into mysql DB, but I'm not very familiar with > the blob data type? > Can someone point me on the right direction how to do this? > > Thanks in advance > Nato > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: blob
On Tue, 2003-01-07 at 15:52, [EMAIL PROTECTED] wrote: > > I agree with this method. i have not yet seen an advantage of storing > blobs in a database. Is there one? i'm sure those on this list would have > an opinion if there was one. personally, i like storing all this stuff on > the file system. There is one advantage. You must either chown the upload directory to the user that your web-server runs as, or chmod it to be world-writable. When creating a web-application that you plan to distribute (like Slashcode), you can't assume that your users will have that privilege. So, storing it in MySQL is a great option. --Dave -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: blob
Why not upload the PDF file to a files directory and just put the path and filename in your database. "Natividad Castro" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi to all, > I want to be able to load PDFs into mysql DB, but I'm not very familiar with > the blob data type? > Can someone point me on the right direction how to do this? > > Thanks in advance > Nato > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php