How to upload a file to memory instead of to the server file system?

Posted on 2008-11-06
Last Modified: 2010-04-21
Hi friends,

I need to upload a file to a server but I dont want to allow the client to access the server file system. I just want to upload it to memory, loop through it and save the records in a DB.
I dont need the file to be stored.

Is there a way in ASP.NET?

Question by:ahll
    LVL 4

    Accepted Solution

    You can get the file stream using something like UploadContol.PostedFile.InputStream and get the text contents using a StreamReader.
    LVL 3

    Author Closing Comment

    Thanks BToson,

    That actually gave me the direction where to look. I finally figured it out.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
    User art_snob ( encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now