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);
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

Undefined Index Notice In Internet Explorer Only
I am getting the following notice:

QuoteNotice: Undefined index: jrox in /home/ycsn/public_h

Fetching META TAGS through
Hello everybody
I want to fetch meta tags of a domain.
It will be done from following code of

Executing an exe
Hi. I have some bizarre problem with exec (other any other method) to launch exe's. I am making a ga

need help with php get
i have a option box that gets filled with dates, but how do i get once the option value has been cli

FROM_UNIXTIME($phpdate);
Hello,

I tried to use this :

$date = FROM_UNIXTIME($phpdate);

ANd I was t

Tree Menu
Hi guys,

Can anyone help me making a tree navigation system? I have a site where I'm allowin

php redirecting
i wont open a new thread but i have a question about redirecting....
i wonder why my code doesnt

While Problem
i am having a problem with a while statement here is the code
Code: [Select]<?php
sess

Dynamic links in an include file
I am working on a small piece of code that counts records from a database and displays the result to

php libs/ browsercap.in
ok i have a host that refuses to stay current. they control my php settings and libs. is there a way

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