使用AJAX进行内联,页面上传文件 [英] Using AJAX to do inline, inpage file uploads

查看:63
本文介绍了使用AJAX进行内联,页面上传文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我想知道是否有人知道任何扩展内联上传的项目

进度条以利用带有栏的内页图片上传器必须刷新
刷新或进入一个单独的页面,也不要打开第二个框来显示

进度条。


我一直在使用改编自Raditha脚本的MegaUpload
http://www.raditha.com/upload.php 。我一直在使用的MegaUpload脚本

取得了onpage的进度条,而不是为栏的

显示打开一个新的页面/框。


无论如何,这是我一直想知道的。我的项目有大量的应用程序用量和Web2.0功能,我想你可以说。

这包括动态表单提交,内联图形界面,

实时聊天,实时绘图/白板等等。我没有用b / b
能够钉上内容的内联进度条使用上传的图像/文件。

有没有人知道目前正在处理这件事的任何项目

我可以贡献给谁?或者,看一些演示代码以获得更好的想法。


我猜我对服务器的请求应该是一个put,但是我会

需要什么从那里修改来处理这个?作为PHP的sux,以及最接近的

,我使用的是OB_函数的修改版本。

Perl解决方案似乎更可行,但我不知道从哪里开始使用

AJAX的异步性质,我认为通过PUT方法发送文件,并且

表格变量(如果有的话),在此栏显示期间从

单独的线程提交到服务器进行存储。


我知道上传器是PHP / Perl,但是它是一个AJAX-savy脚本,

在这里张贴是一个起点。


提前谢谢指向任何/所有项目,以及建议,

帮助和评论。

Hello,

I was wondering if anyone knew of any projects extending the inline upload
progress bar to utilize an inpage image uploader with bar, without having to
refresh or go to a seperate page, nor opening a second box for display of
the progress bar.

I had been using the MegaUpload that was adapted from Raditha''s script at
http://www.raditha.com/upload.php . The MegaUpload script I have been using
takes the progress bar inpage, instead of opening a new page/box for the
display of the bar.

Anyhow, here is what I have been wondering. I have projects with large
amounts of ''application'' usage and Web2.0 features, I guess you can say.
This includes dynamic form submissions, inline graphical interfaces,
realtime chat, realtime drawing/whiteboarding, etc. The thing I have not
been able to nail is inline progress bar usage with uploaded images/files.
Does anyone know about any projects currently working on this very thing
that I could contribute to? Or, see some demo code to have a better idea.

I am guessing my request to the server should be a put, but then I would
need what from there modifed to handle this? As PHP sux for it, and the
closest I have gotten is using a modified verision of OB_ functions. The
Perl solution seems more feasible, but I would not know where to begin using
the async nature of AJAX, I think sending the file via PUT method, and the
form variables(if any), submitted during this display of the bar from a
seperate thread to the server for storage.

I know the uploader is PHP/Perl, but with it being an AJAX-savy script,
posting here was a starting point.

Thanks in advance for direction to any/all projects, as well as suggestions,
help and comments.

推荐答案



JMB < XX **** @ XXXX.XXX>在消息中写道

news:i1%tf.33841

"JMB" <XX****@XXXX.XXX> wrote in message
news:i1%tf.33841


az4.26548@trndny03 ...
az4.26548@trndny03...
你好,
我想知道是否有人知道任何项目扩展内联上传
进度条以利用带有栏的内页图像上传器,而无需刷新或转到单独的页面,也无法打开第二个用于显示进度条的框。

我一直在使用改编自Raditha脚本的MegaUpload
http://www.raditha.com/upload.php 。我一直使用的MegaUpload脚本在页面上取了进度条,而不是打开一个新的页面/框来显示吧。

无论如何,这就是我的意思一直在想。我猜你可以说有大量应用程序使用和Web2.0功能的项目。
这包括动态表单提交,内联图形界面,实时聊天,实时绘图/白板等等。我没有能够指出的内容是上传图像/文件的内联进度条使用。
有谁知道目前正在处理这个问题的任何项目我可以做出贡献吗?或者,看一些演示代码以获得更好的想法。

我猜我对服务器的请求应该是一个put,但是那时我会需要什么从那里修改来处理这个?作为PHP sux,它和我最接近的是使用修改后的OB_函数。 Perl解决方案似乎更可行,但我不知道从哪里开始使用AJAX的异步性质,我认为通过PUT方法发送文件,
和表单变量(如果有的话) ),在显示栏中从单独的线程提交到服务器进行存储。

我知道上传器是PHP / Perl,但它是一个AJAX-savy脚本,
在这里张贴是一个起点。

提前感谢任何/所有项目的指导,以及
建议,帮助和评论。
Hello,

I was wondering if anyone knew of any projects extending the inline upload
progress bar to utilize an inpage image uploader with bar, without having
to refresh or go to a seperate page, nor opening a second box for display
of the progress bar.

I had been using the MegaUpload that was adapted from Raditha''s script at
http://www.raditha.com/upload.php . The MegaUpload script I have been
using takes the progress bar inpage, instead of opening a new page/box for
the display of the bar.

Anyhow, here is what I have been wondering. I have projects with large
amounts of ''application'' usage and Web2.0 features, I guess you can say.
This includes dynamic form submissions, inline graphical interfaces,
realtime chat, realtime drawing/whiteboarding, etc. The thing I have not
been able to nail is inline progress bar usage with uploaded images/files.
Does anyone know about any projects currently working on this very thing
that I could contribute to? Or, see some demo code to have a better idea.

I am guessing my request to the server should be a put, but then I would
need what from there modifed to handle this? As PHP sux for it, and the
closest I have gotten is using a modified verision of OB_ functions. The
Perl solution seems more feasible, but I would not know where to begin
using the async nature of AJAX, I think sending the file via PUT method,
and the form variables(if any), submitted during this display of the bar
from a seperate thread to the server for storage.

I know the uploader is PHP/Perl, but with it being an AJAX-savy script,
posting here was a starting point.

Thanks in advance for direction to any/all projects, as well as
suggestions, help and comments.



几个月前我刚做了类似的事情,很乐意分享代码的价值。我有它在PERL和Python中工作。 PERL是MegaUpload项目的修改版本,而Python版本是我自己的。

在任何一种情况下,我都可以向你发送源代码。你还想要

javascript吗?这部分非常简单。


通过电子邮件告诉我,我会将其传递给它。



I just did something like this a few months ago and would be happy to share
the code. I have it working in both PERL and Python. The PERL is a
modified version of the MegaUpload project and the Python version is my own.
In either case I can send you the source for it. Do you also want the
javascript? That part is pretty straight forward.

Let me know via email and I will pass it along.




JMB写道:

JMB wrote:
我的项目有大量的应用程序用法和Web2.0功能,我想你可以说。这包括动态表单提交,内联图形界面,实时聊天,实时绘图/白板等等。我还没有能够指出的是上传图像/文件的内联进度条使用情况。
有谁知道目前正在处理这件事的任何项目我可以做出贡献吗?或者,看一些演示代码以获得更好的想法。

我猜我对服务器的请求应该是一个put,但是那时我会需要什么从那里修改来处理这个?作为PHP sux,它和我最接近的是使用修改后的OB_函数。 Perl解决方案似乎更可行,但我不知道从哪里开始使用AJAX的异步性质,我认为通过PUT方法发送文件,以及
表单变量(如果有的话) ),在显示栏中从
单独的线程提交到服务器进行存储。

我知道上传器是PHP / Perl,但它是一个AJAX-savy脚本,
在这里张贴是一个起点。
I have projects with large
amounts of ''application'' usage and Web2.0 features, I guess you can say.
This includes dynamic form submissions, inline graphical interfaces,
realtime chat, realtime drawing/whiteboarding, etc. The thing I have not
been able to nail is inline progress bar usage with uploaded images/files.
Does anyone know about any projects currently working on this very thing
that I could contribute to? Or, see some demo code to have a better idea.

I am guessing my request to the server should be a put, but then I would
need what from there modifed to handle this? As PHP sux for it, and the
closest I have gotten is using a modified verision of OB_ functions. The
Perl solution seems more feasible, but I would not know where to begin using
the async nature of AJAX, I think sending the file via PUT method, and the
form variables(if any), submitted during this display of the bar from a
seperate thread to the server for storage.

I know the uploader is PHP/Perl, but with it being an AJAX-savy script,
posting here was a starting point.




上传栏的问题很老(至少从Netscape 3.0开始)。

它是Perpetuum Mobile的网络之一:它在物理条件下无法解决,但仍有很多人试图发明它

而不是阅读物理书籍:-)


限制是建立在HTTP上传模型中。与FTP不同,HTTP

上传是一个没有中间状态的开始/停止事件:你不知道

关于上传数据直到提交开始你仍然不知道

在上传完成之前要处理的实际数据。

HTTP上传的第二个重要限制是在BASE64中发送数据

编码。这意味着实际提交的大小*总是比上传的文件大小摘要大* * b $ b更大*。实际增长

在很大程度上取决于要上传的文件的二进制结构。大概它

不低于+ 20%且高达+ 100%。这就是为什么所有无休止的尝试

根据文件大小+带宽速度制作进度条失败所以

惨不忍睹。


所以为了有一个可靠的HTTP上传进度条你必须

有*在客户端*:

1)一个机制知道确切的上传BASE64之后的文件大小

编码。

2)来自HTTP上传模块的每个打包发送通知。


这两者都不是可以在现有的浏览器上使用。您仍然可以*

编写自己的ActiveX /插件来接管整个HTTP上传

功能(或者在页面上有一个FTP上传器)。没有什么

你可以通过在任何

中使用服务器端和slient-side脚本来执行组合。


P.S.热力学定律从未阻止人们试图发明一款永久性的移动设备。我很害怕进度条就是这样的情况

也不是。 :-)


P.P.S.除W3C Amaya外,目前没有浏览器支持PUT方法。只需要

就可以从一个死枝中拯救你。



The question of upload bar is very old (since Netscape 3.0 at least).
It is one of Perpetuum Mobile''s of the Web: it cannot be solved in the
given physical conditions but still many people are trying to invent it
instead of reading physics books :-)

The limitation is build into the HTTP upload model. Unlike FTP, HTTP
upload is a start/stop event w/o intermediary states: you have no idea
about uploading data until submission starts and you still have no idea
of the actual data to handle until the upload is done.
The second crutial limitation of HTTP upload is that the data is sent
in BASE64 encoding. It means that the actual submission size is *always
bigger* than the summary of file sizes to upload. The actual growth
depends heavily on the binary structure of files to upload. Roughly it
is no less than +20% and up to +100%. This is why all endless attempts
to make progress bar based on file(s) size + bandwidth speed failed so
miserably.

So in order to have a reliable progress bar for HTTP upload you have to
have *on client-side*:
1) A mechanics to know the exact upload size of files after BASE64
encoded.
2) Per packed-sent notification from HTTP upload module.

Neither of this is possible on the existing browsers. You still *can*
write your own ActiveX / plugin to take over the whole HTTP upload
functionality (or to have an FTP uploader right on the page). Nothing
you can do by just using server-side + slient-side scripting in any
shall perform combination.

P.S. Thermodynamic laws never stopped people from trying to invent a
perpetuum mobile. I''m affraid it is the case with the progress bar
neither. :-)

P.P.S. No current browser supports PUT method except W3C Amaya. Just to
save you from of one of dead branches.


这篇关于使用AJAX进行内联,页面上传文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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