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

Checking if multidimensional array is empty?
I have a for with multiple test input fields. Specifically the user submits multiple names and ages

[newb] Image hosting help.
Hey there, I'm new to php, I know some basics and i can code PWN, I'm only 14 but I'm interested in

How can i steam a video on my PHP site? (non YouTube)
Basically I have a PHP site and don't want to give page rank to YouTube. I just want to stream a bas

onClick='location.href=index.htm'> not working
Below is my code:

echo "<input type='button' value='redirect' onClick='location.h

unexpected T_SL without a shift left token
Nothing too see here, I'm an idiot and resolved the problem.

pass form variables straight to email, no database required?
hello all,

im working on this form...

http://www.adobedayevents.com/project_request/pr

upload only text files
hi guys i want to upload only text like like (pdf,note pad and ofiice files) so can any one please t

FAGL_FC_TRANSLATION FAS52 New GL ECC 6.0
Hello,

The new program for Translating GL Balances (FAS 52) gives the option to use diffe

Help with form post data and arrays
Hi all,

I am new to this forum... It has been awhile since i have worked with arrays, and i a

need help about
i store the value of my select statement result to an array and stored it to a variable named $fname

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