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/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page wi

GET * FROM _____ Except?
I have a site that is for stock photography.

This section of the code calls images to display

Display a default image
I am trying to display generic image for items that don't have one, but I can't get it to display.

remove innitial

and

tags
i am using tiny_mce as a text editor for my CMS.
buy now the problem is it add <p>

Posting to another Site?
I have software that people install.
When they install it, is there a way to make it post their d

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

Simpler method of getting variables from mysql
Hi Guys,

I'm trying to streamline my CMS's code and as I was writing a new page it occured to

trouble printing an array....
I'm having some trouble printing out an array forwards. I'm figuring out the high and low of an arra

download directory onto C drive
I am attempting (if this is possible) to write a routine to automatically dump the contents of a dir

pointer 102 question
I read a book
1
2
3
4
5
6
7
8
9
10
11
12
int main() {

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