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

Create comparison matrix?
I want to create a comparison script for forum software and was wondering is there any tutorial or b

mysql_real_escape_string making variable equal nothing
i post a form and i post the variable:
Code: $var = $_POST[variable];then i echo $var its what i

Binding 2 UDP sockets on same port, connected to different destinations, 1 receives
Hello,
My application wants to send/recv data to 2 different UDP ports on a remote computer, us

styling a RadioButtonList
HiI need to have a radio button and close to it, its lable, then a space then another set of those.

Return X values where an ID number doesnt matter
Well as for subject heading, thats the best i could think of.

Currently im having a problem w

Limiting checkboxes?
Hi guys,

I have this code: Code: if(isset($_POST['selected'])) {
foreach($_POST['selec

What am I missing here? Help!
Hello all!. I can't seem to get this working right. Well - it renders right, but something is goin

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

error help - Dynamic Image
I've been working on making my site less cluttered in the directories and more secure lately. In an

Code Help.. If txt input box empty search X instead..
I am having a problem with my search script. At current it will simply search by a selected date whi

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