正在下载文件 [英] Downloading files

查看:86
本文介绍了正在下载文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个网站,其中一页我希望允许用户从许多不同的文件类型下载中进行选择。

文件类型为.docs .jpgs mp3。

我知道如何将文件传输到服务器但我需要什么代码

用于允许用户选择和下载特定文件?显然

他们可以右键点击一个图像并以那种方式下载但是什么

关于压缩文件?


问候Tony

解决方案

文章< 9e ************************* @ posting.google.com> ,

tony melnyk< to ** @ melnyk.freeserve.co.uk>写道:

[...]我需要使用哪些代码来允许用户选择和下载特定文件?显然
他们可以右键单击图像并以这种方式下载但是关于压缩文件的内容是什么?




只需创建文件的链接:


< a href =" foo.zip">下载foo.zip< / a> ;.


-

Jon Bell< jt ******* @ presby.edu> Presbyterian College

美国南卡罗来纳州克林顿物理与计算机科学系


到** @ melnyk.freeserve.co.uk (tony melnyk)写道:

我正在构建一个网站一页其中我希望允许用户从多种不同的文件类型下载中进行选择。
文件类型为.docs .jpgs mp3。


这些不是Internet环境中的文件类型。在因特网上,文件的

类型由其因特网媒体类型表示,例如

application / msword,image / jpeg或video / mpeg 。

我知道如何将文件传输到服务器但是我需要使用哪些代码来允许用户选择和下载特定文件?


您需要提供文件的链接,并且您应该检查

服务器是否发送了正确的Content-Type标头。

显然他们可以右键单击图像并以那种方式下载
但是压缩文件怎么样?




你可以链接到压缩文件(application / application拉链)。有些人有可以处理它们的
软件。请注意,远离强制下载

,压缩即可(即直接下载原始文件,

实际文件格式)_impossible_。


实际上你可以通过查看

常见问题来更快地获得这些信息,特别是
http://www.htmlhelp.com/faq/html/med...download-howto


嗯,诚然,常见问题解答现在有点尘土飞扬,甚至包含有关应用程序/八位字节流的可疑建议。


-

Yucca, http:// www。 cs.tut.fi/~jkorpela/

有关网页制作的网页: http://www.cs.tut.fi/~jkorpela/www.html


< blockquote> 2004年2月7日星期六07:18:05 +0000(UTC),Jukka K. Korpe la $ / $
< jk ****** @ cs.tut.fi>写道:

您也可以链接到压缩文件(application / zip)。有些人有可以处理它们的软件。




有些吗?


我认为一个更好的词会是很多,但这不是基于

任何经验的。


I''m currently constructing a site one page of which I wish to allow
the user to select from a number of different file type downloads. The
file types will be .docs .jpgs mp3.
I know how to transfer the files to the server but what code do I need
to use to allow user to select and download specific files? Obviously
they can right click on an image and download it that way but what
about zipped files?

Regards Tony

解决方案

In article <9e*************************@posting.google.com> ,
tony melnyk <to**@melnyk.freeserve.co.uk> wrote:

[...] what code do I need
to use to allow user to select and download specific files? Obviously
they can right click on an image and download it that way but what
about zipped files?



Simply create links to the files:

<a href="foo.zip">Download foo.zip</a>.

--
Jon Bell <jt*******@presby.edu> Presbyterian College
Dept. of Physics and Computer Science Clinton, South Carolina USA


to**@melnyk.freeserve.co.uk (tony melnyk) wrote:

I''m currently constructing a site one page of which I wish to allow
the user to select from a number of different file type downloads.
The file types will be .docs .jpgs mp3.
Those are not file types in the Internet context. On the Internet, the
type of a file is indicated by its "Internet media type", such as
application/msword, image/jpeg, or video/mpeg.
I know how to transfer the files to the server but what code do I
need to use to allow user to select and download specific files?
You need to provide links to the files, and you should check that the
server sends a correct Content-Type header.
Obviously they can right click on an image and download it that way
but what about zipped files?



You can link to zipped files (application/zip) too. Some people have
software that can handle them. Beware that far from "forcing a
download", zipping makes it (namely direct download of the original,
real file format) _impossible_.

Actually you would have got this information faster by checking the
FAQ, specifically
http://www.htmlhelp.com/faq/html/med...download-howto

Well, admittedly the FAQ is a bit dusty now, and contains even
questionable advice regarding application/octet-stream.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


On Sat, 7 Feb 2004 07:18:05 +0000 (UTC), Jukka K. Korpela
<jk******@cs.tut.fi> wrote:

You can link to zipped files (application/zip) too. Some people have
software that can handle them.



Some?

I would think a better word would be "many", but that''s not based on
anything empirical.


这篇关于正在下载文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆