Custom input file ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • deemoox

    Custom input file ?

    Hi,

    I would like to use input type file, but i would like to put any file in it
    when i go on the page for example when user go back after try to submit

    imagine any form to fill for send information...b ut after the user
    validate....one on the fields is bad...then the user must be correct this
    field.....But i don't want another fields are empty. The user must just
    correct one fields and keep another fields


    any idea ?


  • Erwin Moller

    #2
    Re: Custom input file ?

    deemoox wrote:
    [color=blue]
    > Hi,
    >
    > I would like to use input type file, but i would like to put any file in
    > it when i go on the page for example when user go back after try to submit
    >
    > imagine any form to fill for send information...b ut after the user
    > validate....one on the fields is bad...then the user must be correct this
    > field.....But i don't want another fields are empty. The user must just
    > correct one fields and keep another fields
    >
    >
    > any idea ?[/color]

    Yes.

    If you, some author of some webpage, were allowed to add random files to the
    upload, why not add all kind of files on the client's system?
    And send them to your server without that person's approval.

    So it is a securityprecaut ion.
    The uploadfunctiona lity is crippled on purpose.
    I expect all serious browsers to stop javascript from adding files to the
    upload.

    I think you have to look at a workaround.
    Maybe let the user upload files AFTER all the other data is checked?

    Good luck,
    Erwin Moller

    Comment

    • deemoox

      #3
      Re: Custom input file ?

      thanks, but you make my cry..... i think there are no really good solution
      to my problem..... sic :-(

      "Erwin Moller"
      <since_humans_r ead_this_I_am_s pammed_too_much @spamyourself.c om> a écrit dans
      le message de news:403cbd08$0 $575$e4fe514c@n ews.xs4all.nl.. .[color=blue]
      > deemoox wrote:
      >[color=green]
      > > Hi,
      > >
      > > I would like to use input type file, but i would like to put any file in
      > > it when i go on the page for example when user go back after try to[/color][/color]
      submit[color=blue][color=green]
      > >
      > > imagine any form to fill for send information...b ut after the user
      > > validate....one on the fields is bad...then the user must be correct[/color][/color]
      this[color=blue][color=green]
      > > field.....But i don't want another fields are empty. The user must just
      > > correct one fields and keep another fields
      > >
      > >
      > > any idea ?[/color]
      >
      > Yes.
      >
      > If you, some author of some webpage, were allowed to add random files to[/color]
      the[color=blue]
      > upload, why not add all kind of files on the client's system?
      > And send them to your server without that person's approval.
      >
      > So it is a securityprecaut ion.
      > The uploadfunctiona lity is crippled on purpose.
      > I expect all serious browsers to stop javascript from adding files to the
      > upload.
      >
      > I think you have to look at a workaround.
      > Maybe let the user upload files AFTER all the other data is checked?
      >
      > Good luck,
      > Erwin Moller[/color]


      Comment

      • Erwin Moller

        #4
        Re: Custom input file ?

        deemoox wrote:
        [color=blue]
        > thanks, but you make my cry..... i think there are no really good solution
        > to my problem..... sic :-([/color]


        Of course there are other solutions!
        There are always other solution.

        You could eg store the current state (old form-info) in hidden variables in
        the screen with the upload-element.
        so:
        1) your first part checks all the forminfo.
        If it is not okay, return it to the user and ask him/her to correct it.
        2) when you are satisfied with all the data, offer the upload, and send all
        the other info too as hidden variables.
        You don't even have to change the receiving script that way, only add a
        checkingscript before it that produces the uploadform when all is accepted.

        Maybe I am missing some crucial point over here, not sure.

        just my 2 cents.

        Regards,
        Erwin Moller

        Comment

        Working...