CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2005
    Posts
    42

    Question HTML Controls - File Field

    The property PostedFile.FileName in the control File Field(HTML input controls) is read only. If we want to specify a fixed path, instead the user selects the file - is that possible? If yes how?
    In other words, is there any method to upload a file without the user specifying the path for it. We give the path of file in the code.

  2. #2

    Re: HTML Controls - File Field

    More than likely no... Browser security is designed such that you don't get to say what's permitted on the client side, only the client computer does. Plus, you can't really know what browser and what OS they would connect from (maybe in your project you can, but not on a typical web app)

    What exactly are you trying to do? The best option I can see is to have a user upload a file from a defined directory (ie, where troubleshooting information is, etc.) The only thing you can really do is check the PostedFile and decide if it meets your requirements. It's a good idea to verify the file is what you think it is before doing anything automated with it anyway...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured