Storing A Uploaded File In DB Or Storing It In Filesystem?

May 11, 2010

I have a File Uploader in my ASP.NET application Using C#, we can upload any type like images, documents, pdf etc.

I m storing it in the Filesystem and having only the Name of the File in DB.My doubt is can we store the entire file, images in DB. State me Which is good practice and why we need to use it.

Either file System Storage or SQL DB Storage.

View 4 Replies

Similar Messages:

Forms Data Controls :: Storing Uploaded File Content Into Database?

Dec 15, 2010

I am working on the application that allows user to upload a file (from their local machine) and store the uploaded file in database.Then,the content of the file (such as ContentType,FileSize etc)can be view in a DetailsView control.

View 1 Replies

Web Forms :: "Incorrect Syntax Near The Keyword File" Error When Storing Uploaded File Into Db?

Dec 15, 2010

Actually i am trying to storing the uploaded file into database but when i run this codes:


I got this error: " Incorrect syntax near the keyword 'File'.Incorrect syntax near the keyword 'File'. " can anybody tell me why this error came out?I tried toi change my connection string in web config,but it still showing the same error each time i run it in my local.

View 8 Replies

DataSource Controls :: Storing An Attachment Uploaded By User In RadGrid Into Sql Server 2005 Database

Jun 9, 2010

I am a new-bie in Asp.Net.I am working in a project where I need to store an attachment which will be uploaded by the user in radGrid into Sql server 2005 database.After storing this attachment, I have to retrieve this attcahment and show the same to the other users in radGrid so that they will be able to download the attachment and see that.How should I do that?what kind of datatype would it be?

View 2 Replies

Storing Image In File System?

Apr 3, 2010

Well basically I can't find anything regarding storing an image within a folder on the server, as appose to the SQL database. I have already written code to store the image within my database, but I also need to store the image as a physical entity for CSS purposes, here's a part of my code which can probably be used.

View 4 Replies

AJAX :: Ashx To Storing File In The Server?

Jul 14, 2010

I have created file upload funactionality along with progress bar in my project for this. I have referred following jquery tool you can see here.[URL]with the respective funcationality. i have created one .ashx file for string file on server but when i try to store file on server it gives me error.Could not find a part of the path so i put whole path in the respective code but still i m getting some error. my code is

sfilenamestored = ("\Users\dev5\Desktop\DataAccessLayer\PresentationLayer\"+"/Uploaded_Document/" + upload_files.foldername.ToString()) + "/" + GetUniqueKey() + file.FileName;

View 2 Replies

ADO.NET :: File Upload In MVC Storing As SQL Database?

Nov 8, 2010

I'm having a bit of an issue uploading files to a database. I'll post snippets of my code below.

The table i'm uploading to has the following structure:


I can upload the file using my MVC application without any errors, however in the database the file stores in CoverFileContent as "0x0000000000000000......". All the other information relating to the file, e.g. MimeType, FileName, CoverID, etc uploads correctly. I took a wild guess that this wasn't correct so I downloaded the file (created a .net MVC file downloader). It seemed to download as the correct type of file, however I when I tried to open it, it told me I could not open it. I'll post some snippets of my code so people can see what I'm doing.





I have inserted breakpoints to debug the code, however coming from more of a business background I'm not sure what I'm supposed to be looking for. It seems that the array is being populated with 00000000s so I'm thinking this is a problem regarding the intake of the file.

[URL] This is the tutorial I was originally following, which I got to work perfectly. However when I rewrote it to suit my own needs (using, etc) this problem seemed to occur.

View 1 Replies

Web Forms :: Storing ListBox2 Values In XML File Using Jquery

Oct 20, 2010

I have 2 ListBox1 and ListBox2.When Move items from ListBox1 to ListBox2,I want to save listBox2 values in Xml Files.When i open the page it will load lListBox2 values.

View 1 Replies

C# - Downloading A File After Storing It In SQL Server 2008 Database?

Mar 19, 2011


I've looked all over the web for something that would show me how to do this but can't find it. I have a page that uploads information about an individual including a resume in the form of a doc docx or pdf. I can upload the file okay but I do not know how to, on another page, To download the file that was loaded to that person's row in the database. Here is the upload code


View 1 Replies

Architecture :: Storing Images In Blob Or In The File System?

Jan 11, 2010

I would like to know which is better? Storing images in BLOB or in the File System ? I've got around 400 to 5000 images.

And at run time there are chances where I'll need to retirieve about 100 - 150 images.

View 6 Replies

Web Forms :: Storing Credentials In Web Config File Not Working

May 5, 2014

I am trying to make Login through webConfig but it is not working. When I click on Login with the user and pass it is not redirected to theAllowUsers page.

<authentication mode="Forms">
<forms loginUrl="~/RestrictedArea/Login.aspx" defaultUrl="~/AllowUsers.aspx" timeout="2880">
<credentials passwordFormat="Clear">


View 1 Replies

VS 2010 - Hash Password For Storing In Config File

May 31, 2012

I use this code to use in login

FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword.Text, "SHA1")

My question is how about, i how can convert into a string where it display the user password so that i can send it to the user when he/she forgot it?

View 1 Replies

JQuery :: Multiple File Uploading And Storing In Database Using Ajax

Dec 7, 2010

i want to upload multiple files through file upload or file control at the same time i want to privew that file and also its size and description, only one click on browse file these above tasks must performed, and i can upload multiple files type like pdf,doc,zip and in last i want to store those all files in database binary or any any other data type which is reliable for storing such data. can any one tel me that how can i do this.

View 2 Replies

Storing Umbraco Settings On The File System And Packaging Changes For Deployment

Jul 7, 2010

Does anybody know of an easy way to store Umbraco settings (Document Types, Media Types etc) on the file system in order to manage that data within source control?

Note: changes to settings made on the file system need to be easily integrated back into the CMS database.

Also, does anybody know of a way to package up settings from a development environment for rolling out to staging and live environments?

View 1 Replies

State Management :: Taking Too Much Time To Fetch Data From .xls File And Storing It In To Database

Nov 6, 2010

I am fetching data from .xls file and storing it in to database. Then my users work on a single table where I stored all .xls data. But the problem is that it takes tooooo much time.. So, I want to use cache. But I never used this... Can any one tell me this example how can I use cache with database for increasing application speed?

View 2 Replies

Storing IDs Between Pages For Up To A Day?

Jan 20, 2010

I need to store IDs (Contact IDs, Claim IDs, etc.) between multiple .aspx pages. At the moment I am storing the ID in the Session and have set the Session timeout to 300 minutes. However, I am still getting errors because users are attempting to perform operations after the Session has expired.I think users are leaving their web broswers open, locking their computers, going home for the evening, coming in the next morning and attempting to pick up where they left off.

I don't want to use the Querystring. Cookies are more for User IDs than Contact IDs and Claim IDs. Viewstate is only maintained per page. Persisting Session to a database seems unnecessarily complicated. I don't want to extend the Session timeout too much. I'd ideally like them to be able to pick up where they left off in the morning. What are the best practices for dealing with storing IDs between pages? How can I do this without them receiving a message saying their session has expired?

View 4 Replies

Storing The LoginName In A Variable

Aug 13, 2010

I have a LoginName1, LoginView and Login Status on my Master Page. Whenever a user logs himself in, the LoginName1 displays (as for example):

Welcome omarakhtar

Now the only thing I want is how to store this omarakhtar into some variable? Kindly, let me know.

View 1 Replies

How To Store The Date In Sql Db But It Storing

Sep 24, 2010

i try to store the date in sql db but it storing like 01/01/1900 00:00:00 i want to store the current date

View 5 Replies

Storing Last 10 Web Service Calls?

Feb 18, 2010

I have a SOAP web service and I'm trying to figure how to save/log the last 10 requests for each user. Each user is required to send their user/pass in each request, so it's easy to know who the request originated from. With these last 10 requests saved, my goal is to develop some sort of page that will allow them to log-in with their credentials and view the raw request, the actual SOAP message, http header information, and anything relevant that I can think of.

The point is to allow people to troubleshoot their own connection issues instead of having to contact me each time they can't connect, have trouble formatting their request, etc....

My first thought was to store all this information in memory in a hashtable or something, but that may have scalability issues when we have hundreds/thousands of users hitting the web service.

We could use our database to store these requests. Instead of hitting the database each time, I may need to create some "buffer" mechanism that will only update the database after the buffer gets to a certain number of requests. Is there an existing library or mechanism that will do this?

We can't store these requests on the file system on the machine hosting the web service. Since these requests can potentially contain sensitive information, it's a business decision that I'll need to work around. Or maybe there's a better way to achieve what I'm trying to do?

View 2 Replies

SQL Server :: Storing PDF Into SQL Or Alternatives?

Dec 10, 2010

title isn't as detailed as I hoped but I have a few questions. Traditionally I've always been a mixed mode person, storing PDFs and other things into the file system with pointers from my SQL DB to them.

Recently I've heard more people storing files into the DB directly and wonder if I'm storing files around 100-200MB in size, will I run into a lot of issues? Are there ways to compress the files other than perhaps zipping them up and storing the zip?

Finally, something I've always wondered about but never really found a good work around for... if I decided to continue with the mixed-mode storage solution, and these I need to retrieve these files for use on a website, how do I secure these files so that someone can't just randomly come and retrieve these files off the server by guessing files names, etc?

I did one work around once where I stored a set of PDFs to a non-web directory like c:pdf and setting permissions for the web account to access them. This allowed me to retrieve them using the references in the DB and provide some garbled filename so people couldn't retrieve it themselves but this all seems rather complicated.

View 1 Replies

Storing An Image Map In A Database?

Apr 22, 2010

I have a requirement to allow users in a content management system to create their own image maps through a gui interface, which I have accomplished. But instead of saving the image map to the page code, I want to save the image map code to a database (sql), which I've also accomplished. When I started down this road in my head I was thinking the whole time that I'd just add the "usemap" attribute at runtime shown below where promo1.ImageMap holds the entire map code:

if(promo1.HasImageMap) imgPromotion1.Attributes.Add("usemap", promo1.ImageMap);

I guess I didn't think it though well enough, because it seems that "usemap" only expects the name of the existing map to use from the page code, and not the map code as a string.

how to apply the map from the database to the image at run time?

View 1 Replies

Storing A Column In A Variable?

Oct 22, 2010

I wanted a formatted text to be converted into unformatted text in the UI . for that I did the following

String strInput;
String strOutput;
strInput = txtEditorAnswer.Text;
strOutput = Regex.Replace(strInput, "<[^>]*>", String.Empty).Trim();
txtEditorAnswer.Text = strOutput;
txtEditorAnswer.Text = Server.HtmlEncode(txtEditorAnswer.Text);

but as it changes the value in the Database also, so its creating a problem for future. Now I need to change the text after being inserted into the database.

View 1 Replies

C# - Storing JSON Data In Db?

Jan 3, 2011

I'm trying to store data from fb wall into database.

My *.cs code

public ActionResult GetWall()
JSONObject wallData = helper.Get("/me/feed");
if (wallData != null)
var data = wallData.Dictionary["data"];
List<JSONObject> wallPosts = data.Array.ToList<JSONObject>();
ViewData["Wall"] = wallPosts;
return View("Index");

Which gets posts from fb wall. And then I have an *.aspx file, which "breaks" my wallposts into pieces (objects) or whatever you like to call them.

foreach (Facebook.JSONObject wallItem in wallPosts)
string wallItemType = wallItem.Dictionary["type"].String;
//AND SO ON...

What i'm trying to say is that I can access to elements inside fb JSON.

Is there a way i can access to the JSON elements inside *.cs file. Or is there a way I can store elements inside the *.aspx file to db?

View 2 Replies

Storing Datatable In Memory?

Feb 23, 2011

I have a datatable with morethan 100o records and around 6 to 7 columns. When I get the data into datatable, I use each field to get distinct values and display in different drodownlists. When all the dropdown lists are filled with data, user selects one of them to filter other dropdown lists with the selected value. I want to know how can I keep datatable data stored till I get all the filtering done. I dont want to store the datatable in session as it may occupy so much of memory. Is there any other way to store the datatable till the end of the process.

View 8 Replies

Storing Images In Sqlserver Using C#?

May 17, 2010

i want to store images of my employees with thier profiles in sql server database.i have following reservations.whether i should compress images or not if yes please provide me sample code or article
how should i retrieve images efficiently, i an afraid of application performance issue. i think with ten thousand employee records it will halt or slow down

View 5 Replies

Copyrights 2005-15, All rights reserved