473,782 Members | 2,554 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

User Images: Storing in Files VS Storing in Database

My site includes a feature that allows users to upload an image. (Never more
than one image per user.)

I've been considering storing these uploaded images as a file on the server
with a filename based on the user's ID key (a Guide).

But I'm wondering what some of the advantages and disadvantages are of this
approach over storing the images in the database. If it makes any
difference, the image will be shown on virtually every page.

One thing that I considered is that it will be possible to detect the user
ID of the displayed image from the filename, which could conceivable make it
slightly easier to come up with query argument hacks, although it's not very
likely to be successful. I'd be interested in any other considerations
people have considered.

Thanks.

Jonathan

Jun 2 '08 #1
1 1702
Performance is better if you store the image as a file. If you want the
filenames to be unguessable then you could add some random characters to the
filename.

"Jonathan Wood" <jw***@softcirc uits.comwrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
My site includes a feature that allows users to upload an image. (Never
more than one image per user.)

I've been considering storing these uploaded images as a file on the
server with a filename based on the user's ID key (a Guide).

But I'm wondering what some of the advantages and disadvantages are of
this approach over storing the images in the database. If it makes any
difference, the image will be shown on virtually every page.

One thing that I considered is that it will be possible to detect the user
ID of the displayed image from the filename, which could conceivable make
it slightly easier to come up with query argument hacks, although it's not
very likely to be successful. I'd be interested in any other
considerations people have considered.

Thanks.

Jonathan


Jun 2 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2442
by: mark | r | last post by:
ok, so i now know how to add, edit, delete and search for products (havent figured out categorisation out yet tho) - how do i upload an image and save the file name to the database as part of the admin? something dummies can follow that doesnt use a component (can i throw in a chunk of code and specify the table fieldname and directory the file needs to go into?) cheerz mark
7
3491
by: Benoit St-Jean | last post by:
I am looking at options/ways to store 12 million gif/jpg images in a database. Either we store a link to the file or we store the image itself in the database. Images will range from 4k to 35k in size and there will be 12 millions of them (at the beginning)... I expect a 8% growth every year. We will also have to perform some cleanup jobs to delete images that are not longer referenced by the master table. We'll also have to...
3
2949
by: Dave Smithz | last post by:
Hi There, Being quite new to MS-SQL I would like to ask if there is a general opinion of what approach should be taken to storing things like external documents and images in databases. Should the actual files be stored within the database, or instead should links to the files on a file server or something similar be stored instead. For the end user I imagine it is easier to have everything stored within the
6
3048
by: bissatch | last post by:
Hi, I am currently writing a news admin system. I would like to add the ability to add images to each article. What I have always done in the past is uploaded (using a form) the image to a folder on the server and then in the database table that I INSERT the news article, I'll store the path of the uploaded image. To me this seems a bad idea as if the image paths were changed on the
4
4645
by: IkBenHet | last post by:
Hello, I am working on an ASP.NET based website project. Without going into much detail; One of the function on this website will be the possibility to upload images via a ASP.NET form to the webserver. These images can then be shown on to webpages throughout the site. What would be the best way of storing these images? Just by saving them in a folder on de webserver or in a database?
9
2374
by: Adam J Knight | last post by:
Hi all, Just wondering whats everyones prefered method of storing images ? 1) File System 2) Database (SqlServer) (Seems to be easier, but has a performance hit) Appreciate some insight!!! Cheers,
10
1208
by: Matt Fielder | last post by:
I'm working on converting my application from a single user, to a multi-user. The current architecture is with an MSDE data back end (switching to SQLExpress soon, but not quite yet). Each user connects to the database directly - the connection string is stored encrypted in a local file, and all settings etc. are stored in the database. The problem is it seems that this could rapidly run into problems with scalability and security. The...
4
6957
by: vunet.us | last post by:
I want to know if this practice is effective and secure: I have been thinking about storing some data, which my users upload, in text files rather than database, since often I do not know how much information users submit for things like item description or images URL paths. This information may be very short or very long. MS SQL Server requires a maximum field length to be set. Thus, if user enters 5 characters into 5000 character field,...
0
161
by: Jonathan Wood | last post by:
My site includes a feature that allows users to upload an image. (Never more than one image per user.) I've been considering storing these uploaded images as a file on the server with a filename based on the user's ID key (a Guide). But I'm wondering what some of the advantages and disadvantages are of this approach over storing the images in the database. If it makes any difference, the image will be shown on virtually every page.
0
9474
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10143
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10076
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8964
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5375
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5507
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4040
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2870
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.