欢迎光临
我们一直在努力

"asp无组件上传"算法的改进-ASP教程,性能优化

建站超值云服务器,限时71元/月

前几天帮朋友faintbear修改一个“asp无组件上传”的代码,得了几点心得,写在此处,或许还有点用处。

我没有开发过asp程序,只是临时报佛脚,修改了一下控制语句,所以,这里不再给出asp代码,只是说明一下思路。(你最好在看这篇文章前先浏览一下faintbear的《asp无组件上传的原理 (转) 》这篇文章,重复的部分我不再叙述了)

大体是这样的,一个form表单中可能post多个文本,居各简单的例子:

<form method="post" action="upload.asp" enctype="multipart/form-data">

<label>

<input type="file" name="file1" />

</label>

<br />

<input type="text" name="id" value="234523894"/>

<br />

<input type="text" name="name" value="faint bear"/>

<br />

<input type="text" name="friend" value="smile once"/>

<br />

<input type="submit" value="submit"/>

<input type="reset" value="reset"/>

</form>

—————————–7d429871607fe

content-disposition: form-data; name="file1"; filename="g:\homepage.txt"

content-type: text/plain

宝玉:http://www.webuc.net

—————————–7d429871607fe

content-disposition: form-data; name="id"

234523894

—————————–7d429871607fe–

content-disposition: form-data; name="name"

faint bear

—————————–7d429871607fe–

content-disposition: form-data; name="friend"

smile once

—————————–7d429871607fe–

由于file1可能非常大,而诸如id、name、friend这些要提交的域又非常多,而且file1、id、name、friend的相对位置又不确定(原文中是把这些条目的顺序写死的),如何才能更好的划分流的块呢?

我的思路是:首先按条目来划分块,就是file1、id、name、friend各一块;之后,如果是file类型的,再根据其大小细分成若干块。基本上是这样的结构:

————————–

file1 ————

no.1 block

————

no.2 block

————

no. ….. .. block

————

————————–

id

————————–

name

————————–

friend

————————–

这样就井然有序,既确保的结构的清晰,又解决的大文件上传的问题。

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » "asp无组件上传"算法的改进-ASP教程,性能优化
分享到: 更多 (0)

相关推荐

  • 暂无文章