Jump to content

hide image url


westman

Recommended Posts

ok i got good news and badi can download my images with this code...

header('Content-Description: File Transfer');header('Content-Type: image/jpeg');header("Content-Disposition: attachment; filename=mypic.jpg");readfile('images/pics/3.jpg');

it works fine and has been tested with different type of .jpg filesbut when i download the .jpg file needed i can not open it and i get a windows error..."Windows photo viewer can't open this picture because the file appears to be bamaged, currupted, or is too large."

Link to comment
Share on other sites

It sounds like you might have some unnecessary spaces or line breaks at the end or the middle of the file. readfile() should be the very last thing in your code, and there shouldn't be any spaces or line breaks anywhere else either. Keep all your code inside a single <?php ?> block and make sure that it's on the very first line of the document and that there aren't any blank lines after it.Save the file as UTF-8 without BOM.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...