所以现在我在我的aspx网页上创建了一个简单的上传功能,现在我想编辑我上传的jpeg文件的详细信息,我是先获取文件并使用bitmapmetadata来编辑它还是在那里另一种方式呢?
以下是我上传功能的代码:
<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>
我的aspx页面的后端代码:
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");
}
非常感谢任何帮助。