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

writing a screen scraper
Hello,

I'm writing a screen scraper application and want to be able to get absolute addresses

If statement help please.
Hello on my site I have 2 content boxes. 1 is for the main content (which is the biggest one) and th

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

explode() function problem maybe
Hi I'm having trouble searching my database. When I type two words in the search field it only searc

Find current logon time
Hi,
in my sql script i want to query and find out the logon time of the current session.
<

Random date selection
i want to select random date with time(hour+minutes+sec) where date is specified(10/22/2009) and tim

Facebook status update API
Hello,

So, I'm trying to create my first Facebook application with PHP.

Basic ideas fo

SOAP Issue
Hi,

I am facing some understanding problem with SOAP basic.kindly recommend some SOAP expert.

str_replace help
Hey there,

I'm a PHP newb, I'm having troubles with the str_replace function. I want to clean

A little help needed passing hidden values to next page
I have a page that has hidden values in a form.

example
Code: <input name='signupID

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