473,486 Members | 2,162 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

download web page from c

Hi,

I am wondering is it possible to open a web page with c? I have been
looking for a way to do this for sometime.

Ideally it would be great to have somthing like

FILE *webpage = fopen("http://www.server.com/dir1/dir2/page.html",
"r");

Is this possible? Or are there other ways around this? Also perhaps
there is a lib i can install that would allow this?

Reagrds
Will

Nov 15 '05 #1
6 1313

Will wrote:
Hi,

I am wondering is it possible to open a web page with c? I have been
looking for a way to do this for sometime.

Ideally it would be great to have somthing like

FILE *webpage = fopen("http://www.server.com/dir1/dir2/page.html",
"r");

Is this possible? Or are there other ways around this? Also perhaps
there is a lib i can install that would allow this?

Reagrds
Will


see the curl library. or to reinvent the wheel, see beej's for a socket
tutorial and the http rfc.

Nov 15 '05 #2

"Will" <wm******@gmail.com> wrote

Ideally it would be great to have somthing like

FILE *webpage = fopen("http://www.server.com/dir1/dir2/page.html",
"r");

Is this possible? Or are there other ways around this? Also perhaps
there is a lib i can install that would allow this?

It would be lovely if someone did implement an fopen() that would take URLs
transparently.

Unfortunately you normally have to mess about with non-standard socket
libraries and the like to get internet connectivity out of C.
Nov 15 '05 #3
"Will" <wm******@gmail.com> writes:
I am wondering is it possible to open a web page with c? I have been
looking for a way to do this for sometime.

Ideally it would be great to have somthing like

FILE *webpage = fopen("http://www.server.com/dir1/dir2/page.html",
"r");

Is this possible? Or are there other ways around this? Also perhaps
there is a lib i can install that would allow this?


There is no portable way to do this. On the other hand, an
implementation could support URLs as file names; the C standard says
very little about how file names are interpreted.

Your best bet is to post to a newsgroup that covers your operating
system.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 15 '05 #4
Will wrote:
Hi,

I am wondering is it possible to open a web page with c? I have been
looking for a way to do this for sometime.

Ideally it would be great to have somthing like

FILE *webpage = fopen("http://www.server.com/dir1/dir2/page.html",
"r");

Is this possible? Or are there other ways around this? Also perhaps
there is a lib i can install that would allow this?

My recommendation is to use PHP for this sort of thing. That's what
that language is designed for.

Brian
Nov 15 '05 #5
My prog. is intended to run as in the background of a unix shell and to
periodically check a website. And disp info to the terminal screen. Php
would be no use here...

Nov 15 '05 #6
"Will" <wm******@gmail.com> writes:
My prog. is intended to run as in the background of a unix shell and to
periodically check a website. And disp info to the terminal screen. Php
would be no use here...


What are you talking about? My server no longer has a copy of the
article to which you're replying (and it's not worth my time to go
hunting for it).

Since you're already using groups.google.com, search this newsgroup
for "context, dammit". You'll find an explanation of the problem and
instructions for avoiding it, and get a better idea of just how
tedious and annoying the whole thing has become.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 15 '05 #7

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

Similar topics

3
12378
by: James Kirk | last post by:
The script below allows me to link to a file and as the user clicks to download, the 'File Download' windows appears as normal, and the user can download... The original page is then redirected...
6
8504
by: chon | last post by:
I have an ASP page that is sent a file location as a parameter. It opens this file, loads the ADODB.Stream object and does a binary write to the page forcing the download dialog to appear. This...
3
2258
by: Ron Lessnick | last post by:
I have to continuously download the same web page on our IIS server. It is important to always download a fresh page from the server including not only the .asp page itself but all the .gif and...
0
2559
by: jmd | last post by:
Hello. I want to write a C# program that does completely automatically what, until now, I do manually, witch is describe below : 1. I launch IE (6) 2. I browse to my desired download page, say...
0
1812
by: Buddy Ackerman | last post by:
I am trying to implment a file download via a link such that when clicked, instead of starting the default application for that type of file the user will be presented with a download dialog...
7
2244
by: Brian Paul | last post by:
When a user clicks on a linkbutton on a page, i would like to render a printer-friendly version of the asp.net page and download it as an html attachment to the browser. The code below works great,...
0
1724
by: Rhys666 | last post by:
Basically I have a link that opens my download page and the querystring identifies the type of 'template' Excel spreadsheet has asked to download. The download page reads the querystring,...
3
1613
by: Nathan Sokalski | last post by:
I have a webform that contains a button which I want to do three things: 1. Delete a record from a database 2. Let the user download a text file that is generated 3. Refresh the page to show...
18
16362
by: jmd | last post by:
Hello, I posted the following in the C# forum but without one answer. But perhaps now in vb.net someone has some guidelines ! This is my question : I want to write a vb.net program that does...
5
3665
by: Khafancoder | last post by:
Hi guys, i am building a FileSharing website, i wanna allow users to be able using download managers such as DAP to download files from webserver but don't allow them to retrive files url......
0
7100
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6964
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...
0
7126
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7175
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6842
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...
1
4865
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...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
262
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...

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.