file downloaded can't be read !!


Posted on 16th Feb 2014 07:03 pm by admin

<?php
$fileName = 'mypic.jpg';
$mimeType = 'image/jpeg';
header('content-disposition: attachment; filename=' . $fileName);
Did you know?Explore Trending and Topic pages for more stories like this.
header('content-type: ' . $mimeType);
header('content-length: ' . filesize($fileName));
readfile($fileName);
?>

i tried to download the file called "mypic.jpg" which is stored inside folder called "myfolder"... i use the code written above, n i can download the file but once open nothing was shown up!....

What's wrong?? path?? can anyone help me with this code??
No comments posted yet

Your Answer:

Login to answer
238 Like 10 Dislike
Previous forums Next forums
Other forums

Local file browser with php
Halo..

So this is what i want to create. I have a folder that i share and it has many movies.

Can you help please? Php file
I have to write this php file to allow users to register their nicknames on nickserv

For an I

Insert to MySQL inside foreach
Hey.
I am parsing some html, and putting inside an html db.
I need to create a randomized inte

ImageCreate()
When I create an image and add text to it I want my text to be replaced with a PNG image, because th

Where is my php.ini???
Hi

First off - apologies - i'm not a coder so this may sound very amateur.

I'm having

need help in update query
i create a form for update. there are 8 columns in my mysql table. on my main page all the data is r

Breaking results into week blocks
I have a set of dates (and times), which are returned from a mySQL query.

These usually span

Best way to cross matching large datasets
Hi,

Im running a script where am I cross matching about 200 000 data sets with each other. Ea

Trouble verifying database password
Thankyou to everyone who responded to my last post (I can't find the posting, it has been buried). <

Form submissing with PHP and JQuery/Ajax
I have searched everywhere, but cannot find a solution for this... I have worked all day trying to g

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash