迭代巨型文件上传 - 发明了想要的轮子 [英] Iterated mega file upload - invented wheel wanted

查看:59
本文介绍了迭代巨型文件上传 - 发明了想要的轮子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我必须准备基于Apache / PHP(或更简单的perl)web

页面,允许用户上传非常大的文件,可能是

超过10 GB,可能高达100 GB。


我知道文件上传限制可以通过配置增加

更改;但我宁愿尽量减少需要进行更改,例如

,这既是出于管理原因,也是为了避免可能的(?)内存问题

甚至是错误。


原则上有一个简单的解决方案,用户在初始页面上运行

,他们输入文件名,并且

。提交按钮然后在页面中运行JavaScript。


JavaScript打开文件,位于起始偏移位置

(最初为零),读取和上传最多固定长度

的内容,以及一个延续偏移量(或零$

来表示到达终点),服务器代码重新运行
循环中的脚本,而此返回的偏移量不为零。

后续运行的脚本将绕过数据输入

并直接执行JavaScript 。


无论如何,我的问题是,是否有人写过

类似的东西,理想情况下是进度条?


我预料到的唯一问题是可能的延迟,甚至是
超时,而代码(客户端或服务器)的位置为

下一个读取或写入的偏移量(分别)下一个非常大的
块,例如50 GByte,档案。


感激不尽的任何建议。


(羞耻Apache似乎没有嵌入式FTP

服务器在某种程度上。我猜FTP是显而易见的选择,

但客户端不希望有一个单独的FTP服务器

跑步。)

干杯


John R Ramsden(在glassouse.com上的jramsden)


I have to prepare an Apache/PHP based (or perl if easier) web
page that allows a user to upload very large files, possibly
over 10 Gbytes and maybe up to 100 Gbytes.

I''m aware that file upload limits can be increased by config
changes; but I''d rather minimize the need for changes like
this, both for admin reasons and to avoid possible (?) memory problems
or even bugs.

In principle there''s a simple solution whereby the user runs
an initial page, in which they input the file name, and the
Submit button then runs JavaScript in the page.

The JavaScript opens the file, positions at a start offset
(initially zero), and reads and uploads up to a fixed length
of the contents, along with a continuation offset (or zero
to indicate the end reached), and the server code re-runs
the script in a loop while this returned offset is non-zero.
Subsequent runs of the script would bypass the data input
and execute the JavaScript directly.

Anyway, the question I have is whether anyone has written
anything similar, ideally with a progress bar?

The only problem I anticipate is possible delays, and even
timeouts, while the code (client or server) positions to
the next offset to read or write (respectively) the next
chunk of a very large, e.g. 50 GByte, file.

Any suggestions gratefully received.

(It''s a shame Apache doesn''t seem to have an embedded FTP
server in some way. I guess FTP would be the obvious choice,
but the client doesn''t wish to have a separate FTP server
running.)
Cheers

John R Ramsden (jramsden at glassouse.com)

推荐答案

jo ********** @ sagitta-ps.com 在新闻中写道:1109862480.383312.250480

@ z14g2000cwz.googlegroups.com:
jo**********@sagitta-ps.com wrote in news:1109862480.383312.250480
@z14g2000cwz.googlegroups.com:
JavaScript打开文件,位置在起始偏移处(最初为零),并读取和上传内容的固定长度,以及连续偏移(或指示结束时为零),以及服务器代码在循环中重新运行脚本,而返回的偏移量不为零。
Subseque nt脚本的运行将绕过数据输入
并直接执行JavaScript。
The JavaScript opens the file, positions at a start offset
(initially zero), and reads and uploads up to a fixed length
of the contents, along with a continuation offset (or zero
to indicate the end reached), and the server code re-runs
the script in a loop while this returned offset is non-zero.
Subsequent runs of the script would bypass the data input
and execute the JavaScript directly.




你有一个Perl问题吗?

思南



Do you have a Perl question?

Sinan




A. Sinan Unur写道:

A. Sinan Unur wrote:

jo ********** @ sagitta-ps.com 在新闻中写道:1109862480.383312。 250480
@ z14g2000cwz.googlegroups.com:

jo**********@sagitta-ps.com wrote in news:1109862480.383312.250480
@z14g2000cwz.googlegroups.com:

我必须准备一个基于Apache / PHP(或者如果更容易的perl)
[...]

JavaScript打开文件,位于起始偏移位置(最初为零),并读取和上传内容的固定长度,以及连续偏移量(或零指示已到达的结束),并且服务器代码在循环中重新运行脚本,而此返回的偏移量不为零。
后续运行的脚本将绕过数据输入
并直接执行JavaScript。

I have to prepare an Apache/PHP based (or perl if easier)
[...]

The JavaScript opens the file, positions at a start offset
(initially zero), and reads and uploads up to a fixed length
of the contents, along with a continuation offset (or zero
to indicate the end reached), and the server code re-runs
the script in a loop while this returned offset is non-zero.
Subsequent runs of the script would bypass the data input
and execute the JavaScript directly.



Do you have a Perl question?




阅读第一行,numbnuts:(或perl如果更容易)"



Read the first line, numbnuts: "(or perl if easier)"


< jo ********** @ sagitta-ps.com>在comp.lang.perl.misc中写道:
<jo**********@sagitta-ps.com> wrote in comp.lang.perl.misc:

A. Sinan Unur写道:

A. Sinan Unur wrote:

jo ********** @ sagitta-ps.com 在新闻中写道:1109862480.383312.250480
@ z14g2000cwz .googlegroups.com:
你有一个Perl问题吗?

jo**********@sagitta-ps.com wrote in news:1109862480.383312.250480
@z14g2000cwz.googlegroups.com: Do you have a Perl question?



阅读第一行,numbnuts:(或perl如果更容易)"



Read the first line, numbnuts: "(or perl if easier)"




那么久。


Anno



So long then.

Anno


这篇关于迭代巨型文件上传 - 发明了想要的轮子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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