RE: [PHP-WIN] checking file is mounted at the end of a url
| From: | Mike | Date: | Wed, 20 Oct 2004 14:37:18 +0000 |
| Subject: | RE: [PHP-WIN] checking file is mounted at the end of a url | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-24782@lists.php.net to get a copy of this message | ||
In that case, try using fopen()
http://us2.php.net/manual/en/function.fopen.php
You should be able to check the file handle and check for success or failure
and simply close it after the check is complete.
Just have to have allow_url_fopen enabled in PHP to do so.
-M
-----Original Message-----
From: George Pitcher [mailto:george.pitcher@ingenta.com]
Sent: Wednesday, October 20, 2004 10:28 AM
To: Mike; php-windows@lists.php.net
Subject: RE: [PHP-WIN] checking file is mounted at the end of a url
Mike,
Thanks, but it's not a local file. I host my service, but the file being
cked is (not) mounted on the users' own university website. So I thnk its
more a case or url-checking.
I've tested file_exists using the url and that doesn't work.
Cheers
George
> -----Original Message-----
> From: Mike [mailto:php@crazyted.com]
> Sent: 20 October 2004 3:24 pm
> To: 'George Pitcher'; php-windows@lists.php.net
> Subject: RE: [PHP-WIN] checking file is mounted at the end of a url
>
>
> If you know what the local file name and path are supposed to be, then you
> should be able to use file_exists() for that task.
>
> http://us2.php.net/manual/en/function.file-exists.php
>
> -M
>
> -----Original Message-----
> From: George Pitcher [mailto:george.pitcher@ingenta.com]
> Sent: Wednesday, October 20, 2004 6:47 AM
> To: php-windows@lists.php.net
> Subject: [PHP-WIN] checking file is mounted at the end of a url
>
> Hi,
>
> I'm building a site where among other things, the user (librarian) can see
> if a file has been mounted on a local webserver for students to
> download. I
> could provide a link so they can see if the file (pdf) can be downloaded,
> but I'd rather just say 'yes' or 'no'.
>
> This requires the page doing some sort of url test and reporting yes/no
> depending on the code being sent back. I found something called
> linkchecker
> at Hotscripts.com but when the file doesn't exist, it tries to download
> itself instead.
>
> The user will be accessing my server but will be checking
> something at their
> location. I'm sure this must be possible - can anyone point me in
> the right
> direction?
>
> Cheers
>
> George
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>