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

1,000 select boxes with 100 options?!
I have 1 drop down select box with 1,000 options.


In some case, there will be 100+ of the

cURL Sending File as Post
This is a bit complicated, I'm just hoping someone else has run into this and knows how to do it a d

How to display objects in a row
I have 7 codes that i want to display in a row one next to another.
The first is {$ads->ad

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

Getting PHP to ammended the selected in option field
Hey Guys

thanks for everyones help so far. This site and its users are oozing awesomness.

how to configure ADS in ABAP instance
Hi All,

I am working on r/3 4.7 ABAP system.Can we configure ADS(adobe document services)

Revoking alter any table from a schema
Hi All,

i am working in Oracle 10g.
my requirement is to revoke all kind of DDL oper

natcasesort works on one server but not on another
Hi

I have a problem that I was hoping that someone can help me with.

I'm trying to use

MySQL Primary key gap
Alright, so I have a table with 26 entries in it (id, filename, caption) for my image randomiser (ht

Simultaneous select/update/insert
Hi

How would I need to go about when 2 users update a single row simultaneous? And how would

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