Sockets recieving data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a question that hopefully someone can help me out with. I am trying
to use fop to create a pdf report. I have the fop code created but I can't
figure out how to recieve data.

The data is located here http://localhost:8080/fop/fop?fo=?PATHTOAFILE

Any help would be appreciated

Thanks
Brian
 
If there is a better way to create a pdf report I am open to suggestions
 
I have a question that hopefully someone can help me out with. I am
trying to use fop to create a pdf report. I have the fop code created
but I can't figure out how to recieve data.

The data is located here http://localhost:8080/fop/fop?fo=?PATHTOAFILE

That URL is valid only on the computer where the data is located.

You should provide a post stating clearly and concisely what it is you've
tried so far, and what about what you've tried isn't working for you.

I'll also point out that you don't actually say what "fop" is (it may or
may not be relevant, but I don't know what it is and I'll guess at least
some other people don't either), and you don't actually state specifically
that you're trying to download a file from a web server (though the URL
you've provided implies that you are, we don't know that for sure).

Pete
 
Fop is a program that allows you to create pdf reports

I think I can make it more clear what I am looking for. Basically I have
some php code that I need to migrate to C#.

Here is the code

if ($fp = fsockopen("localhost",8080)) {
stream_set_timeout ($fp,180);
$pdfdata = "";
fputs ($fp, "GET
http://localhost:8080/fop/fop?fo=".$fofile."\n\n");
while (!feof($fp)) {
$pdfdata.=fgets($fp,128);
}
fclose ($fp);
unset($fp);
}

If somebody can help me with this conversion it would be greatly appreciated.

Thanks
 
[...]
If somebody can help me with this conversion it would be greatly
appreciated.

You may want to look at the HttpWebRequest class. Using it you can create
a GET request, retrieve the result, get a stream from that result and save
the data where you like.

If that doesn't address your needs, there are other methods. The
TcpClient class might provide what you need, or if you need even more
low-level access to the connection, you might want to use the Socket class
directly.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top