0

So right now I have created a simple Upload function in my aspx webpage, and now I want to edit the details of the jpeg file that I have uploaded, do I get the files first and use bitmapmetadata to edit it or is there another way to it?

Here are the codes I have for the upload function:

<form id="form1" runat="server">

    <asp:FileUpload ID="FileUpload1" runat="server" />
    <p>
        <asp:Button ID="Upload_Button" runat="server" Text="Upload" OnClick="UploadFile"/>
    </p>
</form>

The backend code for my aspx page:

protected void UploadFile(object sender, EventArgs e)
    {
        if(FileUpload1.HasFile)
        {
            string path = Server.MapPath("~/");
            string filename = FileUpload1.PostedFile.FileName;
            FileUpload1.SaveAs(path + filename);

            Response.Write("File has been uploaded successfully");
        }
        else
        {
            Response.Write("Please select a file to be uploaded");
        }

By details of an jpeg file i mean this: enter image description here

Any help is greatly appreciated.

Jasen
  • 14,030
  • 3
  • 51
  • 68
Marko233
  • 65
  • 1
  • 9
  • 2
    You might start [here](https://stackoverflow.com/questions/11011915/adding-exif-info-to-images-in-c-sharp). This isn't a simple task for all images and files. Even if all the images are jpegs. A lot depends on the device/software that originally encoded and processed the file. Sometimes the metadata may not be included so you'd need to add the frames and offset the image data. Sometimes the metadata you want to insert won't fit in the original allocated space. – Jasen Jan 18 '18 at 03:52
  • alright thanks I will take note of that – Marko233 Jan 18 '18 at 04:26

0 Answers0