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

Multiple submit forms inside a mysql array page
Hi all,

Im having trouble to get the beneath script to work the thing i can't seem to get wor

ImageCreate()
When I create an image and add text to it I want my text to be replaced with a PNG image, because th

Stopped working!
So I had to change some stuff, none of it major. Stuff like the extension_dir and such. BEFORE I did

How can use this array as a key?
Say I have this array for example:


print_r($array);

Prints:
Code: [Select]Array

Multiple WHILE loops help
Hi there. I'm writing an application that is pulling and displaying results for real estate listing

Update data to upper case in parent/child tables
Hi Gurus!

In production we have a product table and which is being reference by many tabl

AutoChoosing a CSS file based on URL
Hey everyone,

I have a site that has multiple URLs and CSS files.

Based on the URL tha

Help With editting and deleting form
Hallo !!

So look at this image :

http://img194.imageshack.us/img194/8272/snapshot5f.pn

Ajax Issues - Update Panel / Timer. Intellisense doesn't know about them
Type 'System.Web.UI.ScriptManager' does not have a public property named 'UpdatePanel'. That is wha

Users and Groups with PHP Classes
Hi,

I have setup what I hope to be a good working User class. Now I want to introduce group m

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