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

Dump with added_funcion cl_salv_table
Hi there, I'm having some troubles adding a self defined function to an ALV in fullscreen. The thing

C++ Http request?
Code: string Response = "LOGIN_UNSUCCESSFUL"; System.Net.WebRequest request = Sy

Setting condidtions for an input box
Hi all,

I would like to set a condition in a txt box that says the number a user enters has t

Need help making a blockquote and line items conditional
I have some code I bought a few years ago that allows my clients to update content on their site usi

XML Grouping
I'm using xml_parse_into_struct to get all my elements, but now I need to group them. For example, h

problem in pagination when processing with selectbox form
Hi,

I have a search form, with select boxes, if am selecting the value from the form, it work

Quick Question about echo value
Hey guys, I'm trying to get something to show differently in one of my scripts. I'm trying to make

Lining up columns nicely.
Hello everyone, I'm having problems with making columns line up properly. Here is my code:

php calculate
this code echoes correctly the sum but the inserted result is 0??
Code: <?php
$TotalNum

Schedule editor
Hi,

I have a question related to Schedule editor.
If we schedule a BLS for every 30

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