Log in

View Full Version : How to "move" a file



costas
10-18-2006, 01:15 PM
Hi to all,

I'm making a site with session security and I want my users to upload and then download a file of any type(*.doc, *.rtf, *.wma, *.txt, *.mp3, *.mp4, *.php, *.html, e.t.c.). I've done so far the uploading but I'm stuck with the downloading! I used the "<a href=''>" but didn't work! Now, I'm trying to "upload" it again in the user's computer but I can't get it work!! The error says that "The Browser does not know what to do with this file". Any help would be appreciated!!

Thanks in advance!!

Costas

A Note: It works if I right-click on the link and open it in a new window! I made it to open in a new window (in the code), but again nothing!

djr33
10-18-2006, 10:25 PM
Can't do anything without more info, a link, and/or the code

costas
10-19-2006, 02:19 PM
Thanks for answering! Well, here's the part of my code(in php) that doesn't work:



while(is_string($w))
{
if($w)
{
$msg .= "<a href=\"C:\files\\$w\" target=\"_new\" type=\"--don't know what type to write--\">$count.$w</a><br><br>";
$count++;
}
$w = strtok(";");
}
$msg .= "</p>";

I want a type that always pops up the download dialog(and then download the file) without checking what the type of the file is, if there's one that does so. I've searched through some web pages with that information(media types), but I can't find anything!

Twey
10-19-2006, 07:31 PM
I'm fairly (if not totally) sure that type isn't an attribute of the <a> element.

costas
10-20-2006, 12:41 PM
Could you tell me where this type goes?
Does it go in the start, where we write "<meta http-equiv="Content-type" content="text/html"; <- does it go here?? -- charset=iso-8859-1" />"! Please, I need some help!!

Twey
10-20-2006, 02:29 PM
It doesn't go in the HTML, it should be sent by the server as a header with the file itself.