Jump to content

download simple problem


robert_gsfame

Recommended Posts

user has uploaded their document named = "my document.doc" and stored inside the database

once downloaded, i get this "my.doc" and ignoring the document as there is some little space between my and document.

 

Can i still get "my document.doc"?? i've tried nl2br but still didn't work

Link to comment
https://forums.phpfreaks.com/topic/183940-download-simple-problem/
Share on other sites

im trying both downloading and showing the image using <img src>

 

below is the code for downloading:

assume myimage table contains the file

 

$fileName=$array['myimage'];

$mimeType = 'image/jpeg';

header('content-disposition: attachment; filename=' . $fileName);

header('content-type: ' . $mimeType);

header('content-length: ' . filesize("folder/{$fileName}"));

readfile("folder/{$fileName}");

 

besides i also tried to show the image using <img src=folder/$fileName> but also didn't appear

okay i got the problem for showing the image as i can str_replace(" ","%20");

but then i tried to use it for the downloading and NOT WORKING >:(

 

there is no problem when storing the record into the table as it has been stored using the name of the file itself although it contains spaces!

 

The problem occurs during the downloading as any character after space cannot be read!

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.