Is there any way to download a image when it is clicked? |
[eluser]chefnelone[/eluser]
[quote author="cereal" date="1293213988"]Or you can create a controller "download" like this: Code: <?php To download just call: http://your.server/download/image/name_of_file.jpg This way you can add a session check to prevent direct linking, keep track of downloads, you can hide the real path and you can use an .htaccess file to prevent downloads from the images/ directory. Bye [/quote] I tried but I'm getting this error: ErrorException [ Warning ]: file_get_contents(http://192.168.1/ci/uploads/galeriasFotos/image_jpg) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found The image is in /uploads/galeriasFotos/ I can see that the problem is that the controller change image.jpg to image_jpg. Why is that? html: Code: <a href="http://192.168.1/ci/download/image/image.jpg"></a> |
Messages In This Thread |
Is there any way to download a image when it is clicked? - by El Forum - 12-24-2010, 04:21 AM
Is there any way to download a image when it is clicked? - by El Forum - 12-24-2010, 05:35 AM
Is there any way to download a image when it is clicked? - by El Forum - 12-24-2010, 05:47 AM
Is there any way to download a image when it is clicked? - by El Forum - 12-24-2010, 06:06 AM
Is there any way to download a image when it is clicked? - by El Forum - 12-24-2010, 06:33 AM
Is there any way to download a image when it is clicked? - by El Forum - 12-24-2010, 06:43 AM
Is there any way to download a image when it is clicked? - by El Forum - 12-24-2010, 06:55 AM
Is there any way to download a image when it is clicked? - by El Forum - 12-24-2010, 08:26 AM
Is there any way to download a image when it is clicked? - by El Forum - 12-24-2010, 09:21 AM
|