Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old January 16th, 2007, 02:05 AM
majik92@gmail.com
Guest
 
Posts: n/a
Default Download a file once

I want a user to download to download bec.exe from download.php. But,
the next time anyone accesses download.php, i want it to turn up a
Error 404 page or simply a sentence saying "sorry, this file is not
available". Could someone help me? Thanks

  #2  
Old January 16th, 2007, 02:25 AM
Sanders Kaufman
Guest
 
Posts: n/a
Default Re: Download a file once

majik92@gmail.com wrote:
Quote:
I want a user to download to download bec.exe from download.php. But,
the next time anyone accesses download.php, i want it to turn up a
Error 404 page or simply a sentence saying "sorry, this file is not
available". Could someone help me? Thanks
>
Have the Download.php file delete, move or rename the file.
Then the message will have the added virtue of being true.
  #3  
Old January 16th, 2007, 12:15 PM
Arjen
Guest
 
Posts: n/a
Default Re: Download a file once

Sanders Kaufman schreef:
Quote:
majik92@gmail.com wrote:
Quote:
>I want a user to download to download bec.exe from download.php. But,
>the next time anyone accesses download.php, i want it to turn up a
>Error 404 page or simply a sentence saying "sorry, this file is not
>available". Could someone help me? Thanks
>>
>
Have the Download.php file delete, move or rename the file.
Then the message will have the added virtue of being true.
Not a good idea on a busy website

Create a unique download id and match it against your stored(allowed) id's
link to the file download.php?id=<my_dl_id>

use fpassthru('/files/file.exe');
to send the file


--
Arjen
http://www.hondenpage.com
  #4  
Old January 17th, 2007, 03:35 AM
Sanders Kaufman
Guest
 
Posts: n/a
Default Re: Download a file once

Arjen wrote:
Quote:
Sanders Kaufman schreef:
Quote:
Quote:
>Have the Download.php file delete, move or rename the file.
>Then the message will have the added virtue of being true.
>
Not a good idea on a busy website
Why? That seems nice and QUICK.

Quote:
Create a unique download id and match it against your stored(allowed) id's
link to the file download.php?id=<my_dl_id>

Gosh, that seems like an awful lot more processing power than
just a simple delete.

Quote:
use fpassthru('/files/file.exe');
to send the file
IS fpassthru an undocumented feature or something?
I can't find anything about it.
  #5  
Old January 17th, 2007, 08:45 AM
Floortje
Guest
 
Posts: n/a
Default Re: Download a file once

Sanders Kaufman schreef:
Quote:
Arjen wrote:
Quote:
>Sanders Kaufman schreef:
>
Quote:
Quote:
>>Have the Download.php file delete, move or rename the file.
>>Then the message will have the added virtue of being true.
>>
>Not a good idea on a busy website
>
Why? That seems nice and QUICK.
yup it does for a single file and a single user.
But if you need a lot of unique download files you dont want to recreate
and delete the same file over and over again.
Quote:
Quote:
>Create a unique download id and match it against your stored(allowed)
>id's
Quote:
Quote:
>link to the file download.php?id=<my_dl_id>
>
>
Gosh, that seems like an awful lot more processing power than just a
simple delete.
You are repeating ur first point wich is valid for some, but not ll
situations
Quote:
>
Quote:
>use fpassthru('/files/file.exe');
>to send the file
>
IS fpassthru an undocumented feature or something?
I can't find anything about it.
Come to think about it .. readfile() would be better but fpassthru would
work

RTFM :-)

http://www.php.net/manual/en/function.fpassthru.php

--
Arjen
http://www.hondenpage.com
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles