上载动画图像 [英] uploading animated image
本文介绍了上载动画图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将动画图像上传到网站?
Hi,
How can I upload an animated image to a website?
推荐答案
问题尚不清楚,但我想您正在谈论要上传动画GIF
文件. >
您可以使用asp:fileupload
控件,并可以进行验证以防止除GIF
......之外的其他文件格式.
Question is quite unclear but i guess you are talking about uploading AnimatedGIF
files..
You can useasp:fileupload
control and can put validation for preventing other file formats thanGIF
...
<asp:FileUpload id="FileUploadControl" runat="server" />
<asp:Button runat="server" id="UploadButton" text="Upload" onclick="UploadButton_Click" />
protected void UploadButton_Click(object sender, EventArgs e)
{
if(FileUploadControl.HasFile)
{
try
{
string filename = Path.GetFileName(FileUploadControl.FileName);
FileUploadControl.SaveAs(Server.MapPath("~/") + filename);
StatusLabel.Text = "Upload status: File uploaded!";
}
catch(Exception ex)
{
StatusLabel.Text = "Upload status: The file could not be uploaded. The following error occured: " + ex.Message;
}
}
}
希望这会有所帮助.
Hope this will help..
用于上传任何类型文件的解决方案
http://hemantrautela.blogspot.in/2012/09/fileimage- updation-or-delete-it-using.html [ ^ ]
您需要检查其扩展名,然后可以使用任何扩展名
solution for uploading any kind of file
http://hemantrautela.blogspot.in/2012/09/fileimage-updation-or-delete-it-using.html[^]
you need to check its extension and then can use it any kind of extension
这篇关于上载动画图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文