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

Table Control
Hi Guru's,

I've created a Module pool program, which contains the Table Control.

listing help
Hi,

at first, great new design!!! I like it,

i got a problem,

I want to list so

Save username into DB
OkaY so I got my blog to actually save the posts and whatever, all I need now is for it to keep the

FlashVar function how to insert variables
Hi guys. Im new in this forum and also new in php programming. Can you help me about this code?
<

SCRIPT ERROR
Here is the CONTACT FORM I made for our website:

<form id="form1" name="

Insert Failing.
Hey,
I am making a Sign up page for a website, but the insert query into the Database does not se

check comment for html
hi, I just wanted to check if a comment a user posts contains HTML, and if it does, to not allow it

I got my hosting suspended XD
So I saw this challenge a day or so ago

http://www.programming-challenges.com/pg.php?page=dow

COOIS - Saving Object Overview WIP Status layouts
COOIS - Would like to be able to save the layout of an Object Overview - WIP Status report. There i

Displaying pictures
i have worked my way through storing images in directory and storing the location in mySQL db.Now i

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