Re: How do i prevent the file from being saved to the tempdirectory when i am OpenStream to save the image myself ...

  •  10-07-2011, 7:31 AM

    Re: How do i prevent the file from being saved to the tempdirectory when i am OpenStream to save the image myself ...

    Hi ScottDolan,
     
    Please use method "CopyTo" to save the upload file.
     
    <%@ Page Language="C#" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <script runat="server">

     
        protected void uploader1_FileUploaded(object sender, UploaderEventArgs args)
        {
            args.CopyTo("~/photos/"+args.FileName);
        }
    </script>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>example</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <div>
                <CuteWebUI:UploadAttachments ID="uploader1" runat="server" OnFileUploaded="uploader1_FileUploaded">
                </CuteWebUI:UploadAttachments>
            </div>
        </form>
    </body>
    </html>
     
     
    Regards,
     
    Ken
View Complete Thread