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

Default TimeZone
The server I'm working with is hosted in America so all times inserted into the database are coming

Comparing MySql data and arrays.
I have a mysql table set up like this:
idsubjectbodyuseriddatetimetags1blog subjectblog body111|2

Email to a friend script problems
I have this send-to-a-friend script with 2 issues:


1) When you open the form popup on a p

PHP page is blank
Hi Everyone,

I have a site in which I am able to open the first PHP webpage in my browser but

PHP and SMS
Hi all forum members. I am new here and am unsure what category shoild I post this in.
Moderator

Open link with largest int string first
I have the following links i would like to open either all at once or one-by-one. How would i procee

Procedure with variable number of columns
Hi, I have a procedure that looks like this:

PROCEDURE PROC(p_cursor OUT sys_refcurso

quick question
Hi ..

i have a question
how do i set a var so it displays via an echo
Code: $logo = '&a

why does my session end?
my connect.php starts the session just so you know
i can navigate arround my site fine except whe

PHP SUBMIT
Code: <input name="doLogin" type="image" src="images/loginsubmit.jpg

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