473,594 Members | 2,839 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to design a file system to store uploaded files via ASP.NET

I'd like to set up a file system for the ASP.NET 2.0 application
to store user-uploaded files, since the members are more than
100,000 people, the basic requirements are as below:

(1) The file system is separate with front-end web site
(2) Need to re-size user-uploaded image file to same size
(3) Need to rename file name to avoid duplicate name
(4) How to design directory and file structure to increase disk I/O
performance
(5) How to scale the file system by adding more HD or file server
(6) What kind of file server? Window 2003 or Linux

Any suggestion? thanks in advance.
Feb 12 '06 #1
4 2540
RedHair,

(1) I would recommend that you don't permit direct access to the filesystem.
Perhaps consider using a database (e.g. SQL Server) to store the files
instead. If you wanted direct file system access, you would need to
configure special permissions to allow the web app security the correct
context for writing to the web server disks. This can pose a big security
risk, no matter which OS is used.

Using SQL Server datatype "image" (sometimes referred to as BLOB, from
Binary Large OBject), you can have up to a 2Gb file in each record, so
there's plenty of storage potential.

(2 / 3 / 4) Using a DB would also remove problems 2, 3 and 4. For (3) you
would use a unique key (primary key) for each file record created in the
storage table. This means you can have duplicate file names if necessary
without conflict. You would need to consider adding a supplemental column
to the table to hold some other value that would allow users to distinguish
the files if same name used. This could be the UserID/name of the person
uploading, or the date-time stamp of the upload, or use both for example.

For point 2, do you mean a file that is a photo, or any type of file such as
a document/spreadsheet?

(5) If you use a hot-swap capable RAID based server or NAS, you should be
able to add more / larger disks and grow your RAID partition into the new
space.

(1 / 6) Since you're posting in the dotnet forums, we can probably assume
you're at least considering to use .NET to create this app, so you'll
probably be wanting a Windows host server. Windows Server 2003 Web Edition
is perfect for this as it is much cheaper than Standard (or Enterprise)
versions and you don't need to buy separate licences. Also, this can host
an MSDE version of SQL server if required to keep infrastructure costs down
to bare minimum, though with your stated user audience, you should probably
consider a separate dedicated DB server. (E.g. SQL Server with CPU
licence(s) for Internet use).

Hope that helps.

Al
"RedHair" <re*****@ms40.u rl.com.tw> wrote in message
news:uo******** *****@TK2MSFTNG P12.phx.gbl...
I'd like to set up a file system for the ASP.NET 2.0 application
to store user-uploaded files, since the members are more than
100,000 people, the basic requirements are as below:

(1) The file system is separate with front-end web site
(2) Need to re-size user-uploaded image file to same size
(3) Need to rename file name to avoid duplicate name
(4) How to design directory and file structure to increase disk I/O
performance
(5) How to scale the file system by adding more HD or file server
(6) What kind of file server? Window 2003 or Linux

Any suggestion? thanks in advance.

Feb 12 '06 #2
Thanks for your detailed reply.
Use db instead of file system is the original idea, but many articles
mentioned
that read/write binary from db costs the performance.
Besides, it is possible to put db generated image file into the cache either
in server or client side?

"Alec MacLean" <al**********@N O19SPAM60.copeo hs.com> 撰寫於郵件新聞: e9************* *@TK2MSFTNGP11. phx.gbl...
RedHair,

(1) I would recommend that you don't permit direct access to the
filesystem. Perhaps consider using a database (e.g. SQL Server) to store
the files instead. If you wanted direct file system access, you would
need to configure special permissions to allow the web app security the
correct context for writing to the web server disks. This can pose a big
security risk, no matter which OS is used.

Using SQL Server datatype "image" (sometimes referred to as BLOB, from
Binary Large OBject), you can have up to a 2Gb file in each record, so
there's plenty of storage potential.

(2 / 3 / 4) Using a DB would also remove problems 2, 3 and 4. For (3) you
would use a unique key (primary key) for each file record created in the
storage table. This means you can have duplicate file names if necessary
without conflict. You would need to consider adding a supplemental column
to the table to hold some other value that would allow users to
distinguish the files if same name used. This could be the UserID/name of
the person uploading, or the date-time stamp of the upload, or use both
for example.

For point 2, do you mean a file that is a photo, or any type of file such
as a document/spreadsheet?

(5) If you use a hot-swap capable RAID based server or NAS, you should be
able to add more / larger disks and grow your RAID partition into the new
space.

(1 / 6) Since you're posting in the dotnet forums, we can probably assume
you're at least considering to use .NET to create this app, so you'll
probably be wanting a Windows host server. Windows Server 2003 Web
Edition is perfect for this as it is much cheaper than Standard (or
Enterprise) versions and you don't need to buy separate licences. Also,
this can host an MSDE version of SQL server if required to keep
infrastructure costs down to bare minimum, though with your stated user
audience, you should probably consider a separate dedicated DB server.
(E.g. SQL Server with CPU licence(s) for Internet use).

Hope that helps.

Al
"RedHair" <re*****@ms40.u rl.com.tw> wrote in message
news:uo******** *****@TK2MSFTNG P12.phx.gbl...
I'd like to set up a file system for the ASP.NET 2.0 application
to store user-uploaded files, since the members are more than
100,000 people, the basic requirements are as below:

(1) The file system is separate with front-end web site
(2) Need to re-size user-uploaded image file to same size
(3) Need to rename file name to avoid duplicate name
(4) How to design directory and file structure to increase disk I/O
performance
(5) How to scale the file system by adding more HD or file server
(6) What kind of file server? Window 2003 or Linux

Any suggestion? thanks in advance.


Feb 13 '06 #3
I've not read that deeply into the performance issues myself, not having had
to produce an app of this type (though one is planned). I'll need to do
some further reading myself, it seems!

I have been working on an app that uploads photo images (HR system, staff
photo) with no discernable speed issues, but this is a Win-forms app used on
local LAN, so direct comparison is probably not a fair one.

It seems logical that there would be a performance hit while the binary file
is "translated " into the stream required to up/down-load, though I don't
know how much impact that has. Probably varies a lot with hardware being
used as well the number of user hits per second/minute. You'd need to weigh
the pro's and cons of the available approaches (between File I/O and DB I/O)
to judge which will best suit your current project's needs.

I've not used caching myself as of this time, but I wouldn't see a technical
barrier with caching at either end. I'm more than happy to be corrected /
illuminated on this though!

Al
"RedHair" <re*****@ms40.u rl.com.tw> wrote in message
news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
Thanks for your detailed reply.
Use db instead of file system is the original idea, but many articles
mentioned
that read/write binary from db costs the performance.
Besides, it is possible to put db generated image file into the cache
either
in server or client side?

Feb 13 '06 #4
Thanks!
"Alec MacLean" <al**********@N O19SPAM60.copeo hs.com> 撰寫於郵件新聞: em************* @TK2MSFTNGP12.p hx.gbl...
I've not read that deeply into the performance issues myself, not having
had to produce an app of this type (though one is planned). I'll need to
do some further reading myself, it seems!

I have been working on an app that uploads photo images (HR system, staff
photo) with no discernable speed issues, but this is a Win-forms app used
on local LAN, so direct comparison is probably not a fair one.

It seems logical that there would be a performance hit while the binary
file is "translated " into the stream required to up/down-load, though I
don't know how much impact that has. Probably varies a lot with hardware
being used as well the number of user hits per second/minute. You'd need
to weigh the pro's and cons of the available approaches (between File I/O
and DB I/O) to judge which will best suit your current project's needs.

I've not used caching myself as of this time, but I wouldn't see a
technical barrier with caching at either end. I'm more than happy to be
corrected / illuminated on this though!

Al
"RedHair" <re*****@ms40.u rl.com.tw> wrote in message
news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
Thanks for your detailed reply.
Use db instead of file system is the original idea, but many articles
mentioned
that read/write binary from db costs the performance.
Besides, it is possible to put db generated image file into the cache
either
in server or client side?


Feb 21 '06 #5

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

Similar topics

7
1670
by: pescott | last post by:
I am still struggling to get some files uploaded to a database as BLOB data. I have 5 includes which allows the user to upload 5 files, numbered accordingly. However, there are script errors. Duhh, why else would I post? Well, here goes: CODE $adres = trim (htmlspecialchars($_POST)); $verkocht = trim (htmlspecialchars($_POST)); $form_description1 = trim (htmlspecialchars($_POST));
9
1446
by: | last post by:
hi.. i don't know if this is the right group for this.. i have a small application which involves a windows service, and web services which bascally retrieves files, process them and zips them away (it's a little more complext then that..) i would like to consult ppl about creating the right classes for it..
13
4295
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming that this is suppossed to end up as a component for others to use, and therefore I do NOT have access to their global.cs::Session_End() how do I cleanup files that were uploaded -- but obviously left stranded when the users aborted/gave up writting...
9
2037
by: Arsen V. | last post by:
Hello, What is the suggested way to store uploaded files? 1) IMAGE type data in an SQL Database table 2) As a file in the NTFS file system Thanks, Arsen
1
6466
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting" setting to be "E_ALL", notices are still not getting reported. The perms on my file are 664, with owner root and group root. The php.ini file is located at /usr/local/lib/php/php.ini. Any ideas why the setting does not seem to be having an effect? ...
12
2874
by: SAL | last post by:
Hello, Is it possible to read a CSV from the Client, and bind my Datagrid to the data in the CSV file without uploading the file to the Server first? I have tried and in Debug mode on my workstation it works fine, but when I publish the page on our DEV server it doesn't fine the CSV file from the client. Has anyone done this before? If so, how do I do it? I'm new to ASP.net so
3
22276
by: Stephan | last post by:
Hi all, I am new to access and I face the following "issue": I would like to create a database, to which users can upload files (=pdf, doc, xls...). The files shall be stored locally on a server. The database needs to be accessed via Access form (no html, asp,...) as we don't have an internal web server running. I would like to create a form that allows the user to browse his local harddrive, select the file and upload it directly...
5
2310
by: djhexx | last post by:
Hello. I have an ASP.NET application (C#) that I allow users to upload files. Files get stored in a SQL2005 database. The file data is stored in a varbinary(max) column. When the user uploads the file, I store it in a database. When a user requests to download a file, the file is retrieved from the database and then sent to them. The files go in there ok. This is how I store them:
1
1307
by: Nosferatum | last post by:
Before I start and try to solve my problem, I wonder if anyone can help me with my challenge: I want to make a system to upload files (mostly word and pdf-files), store them in the file system and store metadata in a mysql db. I will sort all files into one of five main categorys. In addition, I will associate each file in a sub-category for each main category. I know I will get instances where the same file name (the uploaded file)...
0
7946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
7877
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,...
1
8009
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
8240
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6661
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 projectplanning, coding, testing, and deploymentwithout 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
5411
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3867
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...
1
2389
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
1
1482
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.