Skip to content

Code to Stream PDF/Text File from URL

Marc

Asked May 5, 2006, 6:01 AM EDT1 answer
Share
LinkedInX
Thanks in advance everyone, I am a complete neophyte to progamming, but am getting better so please excuse my simplistic verbage. I have an applicaiton that uses a proprietary database. I can pass in a query via a URL over a dedicated port. The url would look like this: http://servername:16200/?indexname=value&indexname=value&doc_type=pdf The return stream from this URL encoded query will be either a pipe delimited .txt file if there are multiple hits, or a PDF or TIF stream if there is only one hit. There is no actual file specified, the "file" is written to disk on the database server, and there is a "listener" that handles the requests and streams back the temp file created on the database server. The problem I am having is how to write a page in C# or ASP.NET that will issue the query, and then determine the content type of the return so that it will either just display the PDF/TIFF (I can do this obviously), or if the return is the pipe delimited text to write that out to the screen (I can do the response.write part no problem). I am assuming I'll need some intermediate page to stream the result to memory or an array or something so I can then handle in on the "main" or "display" page. I've looked at ADODB.Stream and System.IO.Memorystream as possible ways to handle to return but am a little lost. Any direction or code samples would be GREATLY apprecaited. Thanks, Marc

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    You may find some online OR free trial PDF to Word conversion websites, such as Free trial Nemo pdf to word converter or some free PDF to Word converter software, Free download: http://download.cnet.com/Nemo-PDF-to...html?tag=mncol , but these freeware doesn't ensure the conversion quality, either losing data, formatting, or wait for quite a long time. You can also try the paid Nemo PDF To Word, which is worthy, if want the conversion quality and have a lot of files to convert. It supports batch conversion.
    0