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

Php - mysql select?
hi, i have this code:

Code: <?php
session_start();
// dBase file
include &quo

To change the name of label on SAP screen XK02.
Hi All,

Can one suggest me how to change the label of an input field of a sap standard s

Typing math
I've added support for typesetting math using LaTeX on the forums.

Example:
Code: [Select]

mail() problem
Hi Guys,

I've set up a contact email form. It sends the information fine, but it sends it to

Registration
ok so i have a site where people can register and login which works now thanks to someone on here th

how to get IP address?
hey guys,

i have this code which is supposed to get me the IP address of my site visitors:

Form errors in an array
I'm processing a form and putting the errors in an array. empty($errors) doesn't seem to do the tric

grouping within a foreach?
hello all,

I currently have a list of products spit out from my db via a foreach loop. Right

need Array help
This is what I have to do.
$teamname[1] = "Red Sox"
$teamname[2] = "Gian

no idea what to do...
I'm fed up. I had issues with code that I have working on a different site that didn't work on my cu

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