473,387 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

Jan 16 '07 #1
4 2405
ma*****@gmail.com wrote:
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.
Jan 16 '07 #2
Sanders Kaufman schreef:
ma*****@gmail.com wrote:
>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
Jan 16 '07 #3
Arjen wrote:
Sanders Kaufman schreef:
>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.

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.

use fpassthru('/files/file.exe');
to send the file
IS fpassthru an undocumented feature or something?
I can't find anything about it.
Jan 17 '07 #4
Sanders Kaufman schreef:
Arjen wrote:
>Sanders Kaufman schreef:
>>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.
>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.
You are repeating ur first point wich is valid for some, but not ll
situations
>
>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
Jan 17 '07 #5

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

Similar topics

1
by: Arun | last post by:
I have a script for downloading a file from server to a client machine. But once I click download it will ask me whether to save the file or open the file. My requirement is once the download button...
6
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...
4
by: Billy Jacobs | last post by:
Is there a way to download multiple files from a server? If not then: How do I zip up multiple files using the .net classes in vb? Thanks Billy Jacobs
0
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...
1
by: RJN | last post by:
Hi Sorry for posting this again. Requirement is to allow the user to download multiple files at once from browser. User will be displayed a grid on the browser which will list the various files...
0
by: JD | last post by:
Hello Everyone, I am trying to set up a media kit page where when a user comes to the page for the first time and click on the image they wish to download they are brought to a registration...
1
by: rdemyan via AccessMonster.com | last post by:
My App has 10 or so tables that we provide that contains proprietary data. This data will need to be updated once or twice a year. I would like some comments, suggestions on my proposed strategy...
3
by: tshad | last post by:
I have a function that downloads a file to the users computer and it works fine. The problem is that I then want the program to rename the file (file.move) to the same name plus todays date. ...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
6
by: vstud70 | last post by:
Dear friends, I have a website that sells software. In my download page I have a "download" button that once the user clicks it open the windows wizard to /download/save/cancel the software. So...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...

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.