Jump to content

File upload and download


btrsrinivasarao

Recommended Posts

Hi all,

 

I am new to PHP. I am facing problem while upload microsoft word. I am using blob(medium) to upload word document in to mysql.

I am successful in uploading file.I can see the size in database. But i am getting problem while downloading. it is saying some error.

style.css problem some thing like this. could anyone please post the php script to solve my problem

 

THank you in advance.

 

Regards,

Srinivas

Link to comment
https://forums.phpfreaks.com/topic/93052-file-upload-and-download/
Share on other sites

http://www.phpfreaks.com/forums/index.php/topic,6264.0.html

 

2. Don't ask someone to write or re-write a script for you, unless you are posting a message to the PHPFreelancing Forum.  The forums are not the place to request XYZ script.  This is a community of people learning PHP, and not a script location service.  Try searching sourceforge, phpclasses, hotscripts, or Google.

fine you want something, I'm going to try it really simple:

 

<?php

$id = $_GET['id'];

$array = mysql_fetch_array(mysql_query("SELECT * FROM documents WHERE id = '$id' LIMIT 1");

header("Content-type: application/msword");

print($array['file']);

?>

 

I have no idea if it works, I never tested it, I just threw something together, tell me if it works though, it should force a file download, save it with a .doc extention, and try to open it.

 

EDIT: Don't forget to add your SQL connection strings.

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.