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

Escape Latin Characters
I need to escape latin characters in an xml doc. Example: "é" is escaped to "é". I thoug

Error querying database.
I get the above error when trying to insert some values to a datatable.
Here's the code :

Compare user input to flat file data
Help...Am a complete newbie to programming so my code is prolly quite long. Am trying to verify a us

Online Event Ticket Sales
Has anyone wrote a script for online tickets sales?

I have been googling and found lots of th

empty() error
Why does

Code: empty($USER_ID = $_SESSION["USER_ID"])
create this error...

PHP, Arrays & A Lot Of Confusion
I've been doing basic PHP work on sites for a few years now, but I've never been tempted to learn ho

How can use this array as a key?
Say I have this array for example:


print_r($array);

Prints:
Code: [Select]Array

Looking for help reading a .txt or .ini file and outputting the info.
I have a file called Info.ini and It has the following info:
Code: [General]
Online=0
I wou

Help with syntax
Hi all!

The $bridge variable is not getting passed while it is contained in the line below:

PHP onsubmit in the form not going to the fuction.
I have a form through ‘onsubmit’ calling a function validation(). But not going to the

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