Click here to Skip to main content
15,883,901 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

How can I upload an animated image to a website?
Posted
Updated 31-Oct-11 0:10am
v2
Comments
RaisKazi 31-Oct-11 5:51am    
Do you mean to display Animated Image on WebPage Or to upload/save that image on Server?
kiran dangar 31-Oct-11 6:19am    
Hi, please elaborate your question....

Question is quite unclear but i guess you are talking about uploading Animated GIF files..

You can use asp:fileupload control and can put validation for preventing other file formats than GIF...


XML
<asp:FileUpload id="FileUploadControl" runat="server" />
<asp:Button runat="server" id="UploadButton" text="Upload" onclick="UploadButton_Click" />


C#
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..
 
Share this answer
 
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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900