codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Diplay uploaded files  Learner at 08:59 on Saturday, May 08, 2004
 

Hi, I have uploaded files to a folder on my computer and everything works fine. when I try to display the content of the file, I use this code:

Dim CNAME as String = Server.MapPath("..\uploaded_files\" & oComm.Parameters( "@c_randName" ).Value )
Dim oStreamReader as StreamReader
oStreamReader = File.OpenText(CNAME)
Dim fileContent as String = oStreamReader.ReadToEnd()
lblOutput.Text = fileContent
oStreamReader.Close()

this code only reads and display files with 'txt' extention, it doesn't disply 'doc' files. How can I change the code so that it can read and display .doc files correctly?
Many thanks

  Re: Diplay uploaded files  Elain at 08:15 on Monday, November 22, 2010
 

You'd better causion the file name is end up with "txt" or not!
-------------------------------------
flash banner|logo maker|flash menu|








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: FREE TV on your PC!
•  Re: How to edit a PCL file
•  Re: How to open a pop up without Titlebar?
•  Re: Testing if object exists in IE
•  Re: windows service - web service - com
•  Re: Save up to 80% on SSL Certificates, RapidSSL Certificate @ $ 11.00/yr.
•  Re: Using ASP to write RTF
•  Re: My DHTML navigation menu bar disappears WHY?
•  Re: print ...


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2010