Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6975041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:19:01+00:00 2026-05-27T17:19:01+00:00

I want to save uploaded files such as a user’s avatar image to user

  • 0

I want to save uploaded files such as a user’s avatar image to user collection in MongoDB, I guess the steps are:

  1. user upload a image;
  2. use a FileHandler (IHttpHandler, Asp.net) to accept the file stream in web server;
  3. then I get that file binary and set it to a User class object
  4. finally save the object, so the user collection will get the file binary data.

Am I right about this? Could you give me any clue?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:19:01+00:00Added an answer on May 27, 2026 at 5:19 pm

    You should just use GridFS to do it – there is no reason why you should worry about files being too large or too small for it to make sense. GridFS was designed to store files so you should use it.

    You could always store a reference to the GridFS file in a normal MongoDB document if you need to, and then load it out of GridFS when you need to use it.

    See this thread: MongoDB GridFs with C#, how to store files such as images?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i use meioupload to upload files..but i want to save size for everyfile i
I want to save the image which as been uploaded via the PaletteGenForm as
I have a flash upload component I want to use to upload multiple files.
Hope you all will be fine. Actually i want to upload image files from
I want to create a servlet that will allow me to upload image files
I want to upload files from fileupload control and save them as varbinary Filestream
I want to save bandwidth and restrict the size of uploaded files to our
I want to extract first frame of uploaded video and save it as image
i want to save a balance of user, in the user table . the
In my website I want to virus-check any uploaded files before saving them into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.