Reading & Writing to a file on client machine


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Reading & Writing to a file on client machine

Hybrid View

  1. #1
    Jim Guest

    Reading & Writing to a file on client machine


    I have an ASP app where I use the <input type=”file” name=”MyBrowse”> control
    in my form. I would like the user to be able to specify a file on their
    machine for some purpose. When doing this the user is able to use the browse
    dialog to find and select a specific file however, when they submit the form
    and the ASP code grabs the file name selected by the user using strFile =
    request.form("MyBrowse "), the value in strFile if “C:\MyText.txt” for instance.
    The problem is the Web server thinks to look on the local C: drive not the
    client’s C: drive where the file exists.

    How do I get around this? Thanks.


  2. #2
    Simon Guest

    Re: Reading & Writing to a file on client machine


    hi jim,
    you need to post the data in binary format. make sure you have this <form
    enctype="multipart/form-data"> within the form tag
    you may download some sample code here:
    http://msdn.microsoft.com/library/de...ml/asp0900.asp
    good luck
    simon

    "Jim" <dropzone12@yahoo.com> wrote:
    >
    >I have an ASP app where I use the <input type=”file” name=”MyBrowse”> control
    >in my form. I would like the user to be able to specify a file on their
    >machine for some purpose. When doing this the user is able to use the browse
    >dialog to find and select a specific file however, when they submit the

    form
    >and the ASP code grabs the file name selected by the user using strFile

    =
    >request.form("MyBrowse "), the value in strFile if “C:\MyText.txt” for instance.
    > The problem is the Web server thinks to look on the local C: drive not

    the
    >client’s C: drive where the file exists.
    >
    >How do I get around this? Thanks.
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center