SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru
    Join Date
    Feb 2009
    Posts
    996
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Possible to preserve the file path of a file type input element?

    I have a form, that form show some errors.
    Is it possible to, as it happens with other input fields on the form, to preserve the file path?

    Or there is no way since the file path is prior to any server side activity?

    Regards,
    Márcio

  2. #2
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    IIRC, the file input field cannot be prepopulated with a value for obvious security reasons.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  3. #3
    SitePoint Guru
    Join Date
    Feb 2009
    Posts
    996
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I see, we could have a path that points to a specific OS password files for example, and have them as a path on our input file element paths...

    Ok... I still suppose that's a drastic rule by opposing to the cases where we just need to preserve the path, after the user clicked the browse button...

    Anyway, it's more clear now.


    Thanks for the info.

    Regards,
    Márcio

  4. #4
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you can duplicate your form validation with client side JavaScript and hijack the submission, then the file selection would be preserved for the majority of users.
    mikehealy.com.au
    diigital.com art, design . Latest WorkSaturday Morning


Bookmarks

Posting Permissions

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