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

Storing the referrer in session... problems with tabs
Hello All

I am currently working on an ERP project based on the MVC methodology, when a user

php problem?
I don't think I'm stupid, but maybe I am.

I am working on a sit for a friend I am try to put

db entry based on primary key
My "topics" table contains 10 entires
*--------------*
topicid topic
------

records between 2 dates
Hello all,

I have a date tracked table which contains effective_start_date and effective

Update Database
Hi All,


I have a problem with this:

Code: [Select]<?php
session_start();

ASP.NET Validation Event Cycle
Hi,
I have asp button as follow:

Creating an invoice
Using fpdf I am trying to create an invoice to send to clients. The products are sold in pricing tie

switch not getting value
what am i doing wrong?
i want to populate the country list according to the category
i want to

pagination - need help on passing of search query.
Hi, i have been trying for days but couldn't get this sorted out. Would like some professional help

generating random codes
Hi guys n gals,

I have a requirement to generate 250,000 unique codes...

These codes a

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