Upload file and read contents from the stream?

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

  1. #1

    Default Upload file and read contents from the stream?

    I would like to provide an interface for users to upload a csv (or other
    text file). I would like to read the contents of the CSV while it is
    uploading (from the stream). Is this possible? It is no trouble to read it
    once it is saved, but I was thinking I could possibly save a step.

    Thanks,

    Chris


    Chris Holliday Guest

  2. Similar Questions and Discussions

    1. Folder contents upload?
      We replace our photo albums weekly on the company website. We have not figured out how to upload a folder's contents with Contribute - uploading all...
    2. Upload directory and contents from browers
      Is it possible to updoad a directory and its contents from a browser to server...i was reading up on cfftp and was told its only for server to...
    3. Upload (unable to read file)
      hi, i´m trying to upload a file. I tried many ways but it always return the same error... Unable to open c:\file.jpg for reading. the file...
    4. HOW-TO: Datagrid: Read contents of template (textbox) column in ImgBtnClick event
      Hello, I have a template column of my DataGrid filled with textboxes (one textbox inside each cell/row). I have set myTextBox.ID = "myBox" in...
    5. Read the contents of a text file into an HTML page
      "Dutch3001" <mandygretahello@msn.com> wrote in message news:57c4bcf5.0307182134.78d05a86@posting.google.com... html wont do it, and client side...
  3. #2

    Default Re: Upload file and read contents from the stream?


    "Chris Holliday" <chris@noSpamPlease-adventureology.com> wrote in message
    news:#f1RojBPDHA.304@tk2msftngp13.phx.gbl...
    > I would like to provide an interface for users to upload a csv (or other
    > text file). I would like to read the contents of the CSV while it is
    > uploading (from the stream). Is this possible? It is no trouble to read it
    > once it is saved, but I was thinking I could possibly save a step.
    >
    For the archives:

    This is easily handled by doing something like the following:

    Dim str As Stream

    str = MyFile.PostedFile.InputStream()

    Dim myText As String

    Dim sb As New System.Text.StringBuilder()

    Dim sr As StreamReader = New StreamReader(str)

    myText = sr.ReadLine()



    In the above, MyFile is the file input from the webform.



    Thanks,



    C.



    Chris Holliday 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