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 7554529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:21:33+00:00 2026-05-30T11:21:33+00:00

I am doing a ASP .NET website where among other things a user can

  • 0

I am doing a ASP .NET website where among other things a user can upload an image, that needs to be saved to the server.

In the whole website I’m trying to accomplish as minimal communication between the client and server as possible. This means that on onload() I invoke web services which return all data needed for that page, and then manipulate them using javascript.

So far, it has worked flawlessly. The problem arises when a user wishes to make changes to his profile. I can take all the information entered in the text fields and the sort, and pass them as arguments to a webservice which saves them to the database. The thing I dont know how to do, or if it is even possible, is to pass the selected image as an argument to the webservice.

I am using html5: <input type="file"> for the image selection

  • 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-30T11:21:34+00:00Added an answer on May 30, 2026 at 11:21 am

    If you use the asp:FileUpload control instead, when the user clicks submit you can do something similar to the following in the page’s code-behind:

    protected void UploadButton_Click( object sender, EventArgs e ) {
        if ( !ImageUpload.HasFile ) {
            return;
        }
    
        string imageBase64 = System.Convert.ToBase64String( ImageUpload.FileBytes );
    
        YourService service = new YourService();
    
        service.UploadImage( imageBase64 );
    

    This assumes of course that your service has a method called UploadImage that takes a string as a parameter.

    Then on the back end, convert the string to a byte array:

    byte[] imageArray = System.Convert.FromBase64String( base64ImageData );
    

    And save it as binary data to your database.

    As a warning, you may want to add length checks on the webpage to prevent someone from uploading images that are too large… otherwise your server could be bogged down.

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

Sidebar

Related Questions

I have an ASP.NET website (in C#) that takes in user data and then
I've inherited a asp.net website project that currently runs SQL Server 2000 as its
I'm a doing some blackbox testing of a ASP.Net website and I need to
I am doing a hobby project to scrape the content of an ASP.net website
Currently I'm tasked with doing the daily build. We have an ASP.NET 2005 website
I am doing an e-commerce solution in ASP.NET which uses PayPal's Website Payments Standard
I have a ASP.NET website where a user gets large data from a DB
i'm totally confused about configure asp.net website to send email - hope you can
This is driving me mad... I was doing my asp.net sandbox website when out
I have an asp.net website which contains a few pages that I'd like to

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.