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);
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

Mysql query, two times?
Hello to all,

I'm new to php coding and i like it alot. I need help with some noob stuff.

registration form
first time posting. did some searches but didnt find exactly what i am looking for. dont flame cause

using file_get_contents??
okay how would i create a script using file_get_contents() in php have it grab search pages 1-20 and

why this query can delete duplicates ?
why this query can delete duplicates ? Anybody can give me the detailed explanation ?

Tha

Function
How can I make this function that once you click the link in the code it takes you to a new page wit

delete comma
HI,

How to delete "," at the end of the string.
Code: $match = 2009/02/03/a2corr

my sql select id and then update problem.
I need to select some auto incremented ids out of a database and then use those id in a where statem

how to load php class from another domain?
how to load php class from another domain?

how to insert value
I am having file bookissueadd.php..... in which i am having tag

<td height="21&q

PRotect my POST DATA... FROM HTML ATTACKS
I need to like let's say

If a user submit's his Prayer and he put's <meta refresh stuf

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