Postbacks and Input Type=File controls

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Re: Postbacks and Input Type=File controls

    no. that would be a serious security hole. Why not just upload the file to
    the server and display the static filename path in a label of a readonly
    textbox....the user won't know any differnetly.

    Karl

    "Chuck Haeberle" <chaeberl@contractor.nocienaspam.com> wrote in message
    news:%23UAVWteUDHA.1196@TK2MSFTNGP10.phx.gbl...
    > Is there anyway to get around the read-only nature of the HtmlInputFile
    > control's value property?
    >
    > I have a web-form for uploading files but the user is expected to provide
    > additional data about the file being uploaded, which means some
    round-trips
    > to server events as the user populates the required data. This means the
    > user can select a file, then have the file path/name lost during the round
    > trip.
    >
    > I need to find a way around this issue so the user doesn't keep having to
    > re-select the file when they fill out the rest of the form.
    >
    > Help!
    >
    > Thanks,
    >
    > Chuck Haeberle
    >
    >

    Karl Seguin Guest

  2. Similar Questions and Discussions

    1. changing input type file
      i would very very much like to change the browse button on the file upload to one of my own am i right in thinking if i create an inhertited...
    2. HowTo Send Uploaded File with INPUT Type file to Sql Server Image Data Type
      I have the following problem: I have the following form client side: <FORM.......> <FORM action="./WZUpload.asp" method="Post"...
    3. HowTo Send Uploaded File with INPUT Type file to Sql Server Image Data Type ?
      I have the following problem: I have the following form client side: <FORM.......> <FORM action="./WZUpload.asp" method="Post"...
    4. reading the input type=file tag with ie6 in asp
      I wanted to write a simple page to let me choose a directory and then list the files in it. The end goal was to make an easy way to copy all the...
    5. input type=file
      is it possible to define a default or start up directory with input type="file" field type? If so, is it also possible to filter by another...
  3. #2

    Default Re: Postbacks and Input Type=File controls

    I recognize the security holes - but I do not want to persist the uploaded
    file until the user is ready to commit the action - in part because whether
    the file is stored on a file server or in a blob in the database is
    dependant upon the user's selections.

    I have tried various means of caching the uploaded file in the Session (ugh)
    (failed - the reference to an HttpPostedFile itself becomes invalid on on
    the next post it seems) or Viewstate (failed, httpPostedFile is not a
    'sizable' object). My next considered option is to use GetInputStream,
    stream the uploaded file into a MemoryStream, cache that in either viewstate
    if it will let me, or in the Session otherwise, capture the uploaded
    filename and content type and other info, cache them as well, display the
    label you recommended, and when the user finalizes, stream it out again into
    my attachmentmanager component. Ugh again.

    Why do the users have to make the requirements so annoying. :)



    "Karl Seguin" <kseguin##crea.ca> wrote in message
    news:OpmUBtfUDHA.2012@TK2MSFTNGP10.phx.gbl...
    > no. that would be a serious security hole. Why not just upload the file
    to
    > the server and display the static filename path in a label of a readonly
    > textbox....the user won't know any differnetly.
    >
    > Karl
    >
    > "Chuck Haeberle" <chaeberl@contractor.nocienaspam.com> wrote in message
    > news:%23UAVWteUDHA.1196@TK2MSFTNGP10.phx.gbl...
    > > Is there anyway to get around the read-only nature of the HtmlInputFile
    > > control's value property?
    > >
    > > I have a web-form for uploading files but the user is expected to
    provide
    > > additional data about the file being uploaded, which means some
    > round-trips
    > > to server events as the user populates the required data. This means
    the
    > > user can select a file, then have the file path/name lost during the
    round
    > > trip.
    > >
    > > I need to find a way around this issue so the user doesn't keep having
    to
    > > re-select the file when they fill out the rest of the form.
    > >
    > > Help!
    > >
    > > Thanks,
    > >
    > > Chuck Haeberle
    > >
    > >
    >
    >

    Chuck Haeberle Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139