473,804 Members | 2,148 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Streaming text output.

I have a call to wget that transferres a file of about 30 meg at about 1
meg per second. This has the user waiting 30 seconds or so before the
page responds. What I want to do is send the ouput of wget while it's
happening, which is proving a bit iffy.

$modprog = popen('/path/to/wget/shell/script', 'r');
$buffer = fopen($modprog, "1");
$display = fgetc($buffer);
echo $display;
pclose($modprog );

doesn't work for what may be obvious reasons to those in the community.
I don geddit. Any suggestions please?

--
Virtue is its own punishment.
Jul 17 '05 #1
2 5539
Handover Phist <ja***@jason.we bsterscafe.com> wrote
in message news:<slrnbuets b.16r.ja***@jas on.websterscafe .com>...

I have a call to wget that transferres a file of about 30 meg
at about 1 meg per second.


Why do you have to involve wget at all? Let's say you need to
dump into the standard output a file that resides at this URL:

http://www.yourhost.com/your/path/your.file

Here's what you can do:

$host = 'www.yourhost.c om';
$path = 'your/path/your.file';
$fp = fsockopen ($host, '80');
if ($fp) {
fputs($fp, 'GET '.$path." HTTP/1.0\r\nHost: ".$host."\r\n") ;
} else {
die ('Oops... Nobody home...');
}
while (!feof ($fp)) {
echo fgets ($fp, 10240);
}
fclose ($fp);

Another workable alternative would be to use cURL:

http://www.php.net/curl

By default, curl_exec() will do exactly what you want: dump
a remote file into the standard output...

Cheers,
NC
Jul 17 '05 #2
Handover Phist <ja***@jason.we bsterscafe.com> wrote in message news:<slrnbuets b.16r.ja***@jas on.websterscafe .com>...
I have a call to wget that transferres a file of about 30 meg at about 1
meg per second. This has the user waiting 30 seconds or so before the
page responds. What I want to do is send the ouput of wget while it's
happening, which is proving a bit iffy.

$modprog = popen('/path/to/wget/shell/script', 'r');
$buffer = fopen($modprog, "1");
$display = fgetc($buffer);
echo $display;
pclose($modprog );

doesn't work for what may be obvious reasons to those in the community.
I don geddit. Any suggestions please?


I think popen returns a file pointer so you do not need

$buffer = fopen($modprog, "1");

You can directly call

$display = fgetc($modprog) ;

Hope it will help....

--Rahul
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3188
by: DMS | last post by:
I need to create some specifications and budget request for a workstation (G5) and all necessary hardware and software for authoring online college courses. The course material would contain short bits of streaming video and audio, short bits of animation, text and webforms. (I don't have to consider serving the output) This has to be done before someone is hired to do the authoring. What software or specialized hardware would anyone...
22
5716
by: googlegroups | last post by:
I am playing with the XMLHTTPRequest method to perform client/server transactions. I have it set up right now so that when readyState is 4, it takes the XML and processes it. This works great until there is alot of data. In that case, the user will have to wait for the data to come back which may take a minute or so. I don't want the user to have to wait. Is it possible for javascript to periodically (while still receiving more data)...
0
1180
by: Nuno Magalhaes | last post by:
Hello all, I'm capturing the screen to a file (C:\output.wmv) as video source but now I have a big problem: How can I get the output sent to a remote host instead of a file? And, by the way, how can I handle it on the client side? Any help on this would be great, since there is no much info on the net about this matter.
5
1569
by: John | last post by:
Hi all, I have an (well, what I think to be, at least) interesting question: Is it possible to stream data down to the client and, after a certain amount of data has been streamed, allow the client to begin interacting with that data whilst still streaming data down? Also, if it is possible, how would one go about coding this? Would some sort of predfined bit of streaming be finished and notify the client (i.e. some form of Javascript...
1
4362
by: Andrew | last post by:
I'm adding this as it to me a while to figure out all the pieces to be able to do this without using Microsoft.Office.Interop which caused me problems on the web-server. Streaming is the easy part, but I couldn't initially work out how to manipulate the page setup to change page margins and orientation, that's why I was looking at Microsoft.Office.Interop. But with Microsoft.Office.Interop I couldn't fiure out how to stream HTML...
3
2345
by: A.M-SG | last post by:
Hi, I have a ASP.NET aspx file that needs to pass large images from a network storage to client browser. The requirement is that users cannot have access to the network share. The aspx file must be the only method that users receive image files.
6
2734
by: | last post by:
Hi all, is there a better way to stream binary data stored in a table in sql 2005 to a browser in .net 2.0? Or is the code same as in .net 1.1? We noticed that in certain heavy load scenarios, every now and then the client would timeout and have to re-initiate the request... TIA!
4
13392
by: ed | last post by:
Hi all, I'm very new to vb (2nd day) and I need to create a small app that will replace my old batch file with a flashy gui. I had some experience with access 2.0 which helps ;) What I would like is to get the output of the batch file to display on the gui as the batch file is running. if some of you understand unix... I want this: tail -f /var/log/messages
1
2865
by: Faisal Shafiq | last post by:
I want to upload a file direct to the Silverlight Streaming Service from a Web Client such as silverlight application. As per our product requirement we want to upload a .WMV file directly from silverlight client to Silverlight streaming service. I tried to user WebClient and HttpWebRequest for that purpose but, unfortunately I can found the way to do so. There are some problems with both classes. 1. There is no property of get...
11
1301
by: Alexander Adam | last post by:
Hi there! I've got a few (more generic) questions for those C++ experts out there. 1. I am trying to store any kind of data (custom PODs, numbers, strings etc.) within some kind of stream which consists of an unsigned char* array which gets resized whenever needed. Writing and reading is done by using a simple memcpy(). Is this the most efficient method considering that a single stream might include up to 10 different data
0
9593
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9169
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7633
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5529
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5668
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4306
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.