Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Upload images to database instead of to files


bcraigie

Recommended Posts

The ISP that my client is using for his site doesn't support file uploading in PHP (for security reasons as it is a shared server).

 

I don't want the clients using ftp to upload images because they might make a mess of things.

 

The easy answer is to store the images in blobs in a new table in the database instead of in files. Before I go and re-invent the wheel, has anyone already made mods to do this? I've searched the contribs, but not found anything like this, unless I'm not looking hard enough.

 

TIA,

 

Brian

Link to comment
Share on other sites

The ISP that my client is using for his site doesn't support file uploading in PHP (for security reasons as it is a shared server).

 

I don't want the clients using ftp to upload images because they might make a mess of things.

 

The easy answer is to store the images in blobs in a new table in the database instead of in files.  Before I go and re-invent the wheel, has anyone already made mods to do this?  I've searched the contribs, but not found anything like this, unless I'm not looking hard enough.

 

TIA,

 

Brian

 

Sounds like a weak hosting company. Go somewhere else for your hosting needs.

Link to comment
Share on other sites

I think so too, the next message from your host will be that your mysql usage is too high because of all the images you are accessing.

 

It's only a small shop with a few images, and changing hosts isn't going to be a cost-effective option for them.

 

OK, so I'll maybe just do theirs by ftp and charge a small maintenance fee. I don't know of any ISP that will allow http file uploads on a shared server, as the directories need to be owned by the o/s user that the http server runs under, thus giving http upload access to all the folders by all the people sharing the server, so it would be a big security hole. I'll need to investigate it some more.

 

Thanks everyone for your answers. :-)

 

Brian

Link to comment
Share on other sites

It's only a small shop with a few images, and changing hosts isn't going to be a cost-effective option for them.

 

OK, so I'll maybe just do theirs by ftp and charge a small maintenance fee.  I don't know of any ISP that will allow http file uploads on a shared server, as the directories need to be owned by the o/s user that the http server runs under, thus giving http upload access to all the folders by all the people sharing the server, so it would be a big security hole.  I'll need to investigate it some more.

 

Thanks everyone for your answers.  :-)

 

Brian

 

I just altered the images directory permissions from 755 to 775 (adding the group write permission) and that has sorted the problem. However, it now leaves the directory open to all other users in the same group. I'll need to confirm with the ISP what the security ramifications are, but that's good enough for now.

 

Thanks again.

 

Brian

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...