Original File information

Last post 01-25-2011, 12:21 PM by Eric. 5 replies.
Sort Posts: Previous Next
  •  10-09-2008, 7:58 AM 44728

    Original File information

      How can I retrieve the original file location?  I see the file name and size, but nothing about location.  Is there any more information elsewhere?
     
     
    Thanks!
  •  10-09-2008, 8:30 AM 44730 in reply to 44728

    Re: Original File information

    >>How can I retrieve the original file location? 
     
    Do you mean the original file location on the client machine?
     
    If so, it's not available.

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  01-24-2011, 8:27 AM 65852 in reply to 44728

    Re: Original File information

    please help me. I am also facing the same issue.
  •  01-24-2011, 11:13 AM 65857 in reply to 65852

    Re: Original File information

    Dear buddalasunil999,
     
    We are not able to provide the path of the file, because Flash/Silverlight and some browser's <input> do not provide that information.
     
    Thank you for asking
     
     
  •  01-25-2011, 3:23 AM 65864 in reply to 65857

    Re: Original File information

    can I atleast find the created_date of the original file?
    when I select a file, the control will create a .resx file in the temp location. what does this file contain? is there anyway to read this file?
    and if the temp location is not available what will this do? can I check for this path existence and if not available I should create on fly.
  •  01-25-2011, 12:21 PM 65872 in reply to 65864

    Re: Original File information

    Dear buddalasunil999,
     
    can I atleast find the created_date of the original file?
          Ajax Uploader doesn't provide this kind of information. Related topic can be found in http://cutesoft.net/forums/thread/56698.aspx

    when I select a file, the control will create a .resx file in the temp location. what does this file contain?
          The file is same as uploaded file, the only difference is the file name, we add "resx" as the postfix, it is based on security consideration.
     The the .resx postfix can help the server to prevent being hack by uploading a script file.
     
     is there anyway to read this file?
          Yes, you can read this file.
          void Uploader_FileUploaded(object sender, UploaderEventArgs args)
          {
            Uploader uploader = (Uploader)sender;
            InsertMsg("File uploaded! " + args.FileName + ", " + args.FileSize + " bytes.");
            //Copys the uploaded file to a new location.
            args.CopyTo("~/uploads1/"+args.FileName);
            //You can also open the uploaded file's data stream.      
            byte[] data = new byte[args.FileSize];
            using (Stream stream = args.OpenStream())
            {
                stream.Read(data, 0, data.Length);
            }
        }      
         
    and if the temp location is not available what will this do?
               If temp directory is not available, error will be thrown.

    can I check for this path existence and if not available I should create on fly.
              Yes, you can check whether path is existing.
              args.CopyTo("~/uploads1/"+args.FileName);
              Before the uploaded files are copied to destination folder, you can check whether the path is existing.
     
    Thank you for asking
    [email protected]
View as RSS news feed in XML