Support forums

reading properties of uploaded files

Last post 10-20-2010, 8:12 AM by Eric. 1 replies.
Sort Posts: Previous Next
  •  10-20-2010, 3:11 AM 64518

    reading properties of uploaded files

    I was wondering if anyone had been playing around with reading the properties of uploaded files (ie. geo-codes, dates, etc. of uploaded image files).
    Filed under:
  •  10-20-2010, 8:12 AM 64528 in reply to 64518

    Re: reading properties of uploaded files

    Dear mulmad,
    Please refer to the highlighted code:

    <%@ Page Language="C#" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

    <script runat="server">
        void InsertMsg(string msg)
            ListBoxEvents.Items.Insert(0, msg);
            ListBoxEvents.SelectedIndex = 0;

        void Attachments1_AttachmentAdded(object sender, AttachmentItemEventArgs args)
            InsertMsg(args.Item.FileName + " has been uploaded.");

        void ButtonDeleteAll_Click(object sender, EventArgs e)
        void ButtonTellme_Click(object sender, EventArgs e)
            foreach (AttachmentItem item in Attachments1.Items)
                InsertMsg(item.FileName + ", " + item.FileSize + " bytes.");
                //Copies the uploaded file to a new location.
                //You can also open the uploaded file's data stream.
                //System.IO.Stream data = item.OpenStream();

    <html xmlns="">
    <head runat="server">
        <title>Uploading multiple files like GMail</title>
        <link rel="stylesheet" href="demo.css" type="text/css" />
        <form id="form1" runat="server">
            <div class="content">
                    Uploading multiple files like GMail</h2>
                    Google's GMail has a nice way of allowing you to upload multiple files. Rather than
                    showing you 10 file upload boxes at once, the user attaches a file, you can click
                    a button to add another attachment.
                <br />
                <CuteWebUI:UploadAttachments InsertText="Upload Multiple files Now" runat="server"
                    ID="Attachments1" MultipleFilesUpload="true" OnAttachmentAdded="Attachments1_AttachmentAdded">
                    <InsertButtonStyle />
                <br />
                <br />
                <asp:Button ID="ButtonDeleteAll" runat="server" Text="Delete All" OnClick="ButtonDeleteAll_Click" />&nbsp;&nbsp;
                <asp:Button ID="ButtonTellme" runat="server" Text="Show Uploaded File Information"
                    OnClick="ButtonTellme_Click" />
                <br />
                <br />
                    Server Trace:
                    <br />
                    <asp:ListBox runat="server" ID="ListBoxEvents" Width="400"></asp:ListBox>

    Thank you for asking



View as RSS news feed in XML
Powered by Community Server (Commercial Edition), by Telligent Systems