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

line breaks in between fetched file names
Hi,

I have this code:
Code: <?php
if($dir = opendir('files')){
while (($f

asp authentication problem
Hello all, I want to use the asp authentication (from asp.net configuration) in my web site. there

bind error during socket programming
i am kinda new to socket programming. wrote the below code for a server. but getting the bind error

making web pages for accounts
Hello, I would like to make pages for accounts on my website im making (its not a real website..im j

Filtering for a phrase using pregmatch
Here is my code which looks for addresses which start with ' src=" '

Code: [Select]preg_

CODE NOT WORKING
Code: [Select]<?php
//include shared codes

include '../lib/common.php';
include

frames get header location..
i have two frames, one top, one bottom. how do i do a form on the bottom frame that gives me the ur

using variables in another page
I have a test database set up on localhost. I have a form that I can type a name into, hit the butto

Price in PR
Dear Experts,
Why we have to enter the price in the PR, and why there is no free goods indicato

Bandwidth monitoring?
Hi guys,

I need a little information I have written a php app and I occurred to that I need

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