14/12/2010, 05:10 PM
14/12/2010, 06:30 PM
you could have the download link bring you to a page that has the php code in it, then have the php code download the file, then if they right click and hit save as, it will save the php page
so just in case someones confusesd itll go
download link > php page > php page downloads automatically
so if they right click, theyll actualy donload this
|
V
download link > php page > php page downloads automatically
instead of that ---------------------|
V
download link > php page > php page downloads automatically
happy now?
so just in case someones confusesd itll go
download link > php page > php page downloads automatically
so if they right click, theyll actualy donload this
|
V
download link > php page > php page downloads automatically
instead of that ---------------------|
V
download link > php page > php page downloads automatically
happy now?
14/12/2010, 07:16 PM
haha! That is brilliant!
except it totally didn't work like that. :(
download.php =
except it totally didn't work like that. :(
download.php =
PHP Code:
|
and get.php is the script I posted earlier.
It downloads the file correctly, but 'Save As' still works. :(
poop!
14/12/2010, 07:48 PM
nurehtix Wrote: [ -> ]Well I don't really care if it always works, I'd just like to thwart the average user.Then you're doing it the wrong way.
Really, the only reason I'm bothering is to track downloads; to see how many people are downloading our releases, and the tracking script is an 'onclick' one.
The PHP script should be counting downloads, JS really shouldn't be tracking downloads.
Perhaps have a little .txt file with the number of downloads stored there, and update it every time a download is hit.
Actually, best method would be just to provide a direct link and count downloads via webserver logs.
With this, you also don't have problems with pausing/resuming downloads, as well as multipart downloading, since the webserver handles all this, but your script doesn't.
By the way, your PHP script needs to check inputs more.
Otherwise, stuff like this works: http://deletefunction.com/download.php?f...wnload.php
Probably not an issue for you, but if you ever put stuff you don't want others to see, you may want to be aware of it.
14/12/2010, 08:07 PM
ZiNgA BuRgA Wrote: [ -> ]Then you're doing it the wrong way.
The PHP script should be counting downloads, JS really shouldn't be tracking downloads.
Perhaps have a little .txt file with the number of downloads stored there, and update it every time a download is hit.
Actually, best method would be just to provide a direct link and count downloads via webserver logs.
With this, you also don't have problems with pausing/resuming downloads, as well as multipart downloading, since the webserver handles all this, but your script doesn't.
Well, I'm actually tracking downloads with Google Analytics right now, but if there's a better way, feel free to show me. :D
EDIT: I changed the download.php a bit, so it (kind of) tracks downloads. See below:
ZiNgA BuRgA Wrote: [ -> ]By the way, your PHP script needs to check inputs more.
Otherwise, stuff like this works: http://deletefunction.com/download.php?f...wnload.php
Probably not an issue for you, but if you ever put stuff you don't want others to see, you may want to be aware of it.
lmao.
I'll do something simple:
PHP Code:
|
14/12/2010, 08:31 PM
Better:
PHP Code:
|
14/12/2010, 08:45 PM
Awesome, thanks much, Zinga.


14/12/2010, 10:14 PM
use javascript to disable right click?
14/12/2010, 10:17 PM
I almost considered going that route, but that annoys the spoon out of me when a website is like that. :p