使用单个文件元素上载多个文件

使用单个文件元素上载多个文件

问题描述:




我正在使用 http://the-stickman.com/web-developm...-file-element/ 使用单个文件元素上载多个文件。它工作正常,但对于每个上传的文件,我想存储描述文件的文本文件的内容。


我试图理解代码,但我不是一个Javascript或XML大师。有人会很友好地看看代码并告诉我哪里出错了。


我有以下内容:

Hi,

I''m using the code at http://the-stickman.com/web-developm...-file-element/ to upload multiple files with a single file element. It works fine but for each file uploaded I want to store the contents of a text file which describes the file.

I''ve tried to understand the code but I''m not a Javascript nor XML guru. Would anyone be kind enough to look at the code and tell me where I''m going wrong.

I have the following:

展开 | 选择 | Wrap | 行号

Heya,Sean。


您希望代码做什么?举个例子。

你的代码是做什么的,你不想要它做什么?举个例子。

你的代码是什么*不是*它应该这样做?举个例子。
Heya, Sean.

What do you want your code to do? Give an example.
What is your code doing that you don''t want it to do? Give an example.
What is your code *not* doing that it is supposed to? Give an example.


Hiya,


目前它创建了一个div部分,其中依次显示每个文件上传的名称,它也创建了file_0,file_1等文件元素的名称/ id,以便可以在服务器端脚本(如PHP)中访问每个文件名。想要扩展到它是为了能够为每个上传文本描述的文件存储。上传文件的代码如下: http://the-stickman.com/web-developm...-file-element/

谢谢,


Sean

Hiya,

Currently it creates a div section where the name of each file upload in turn is displayed and it also creates a name/id for the file element of file_0, file_1 etc so that each file name can be accessed in a server side script such as PHP. Want I want to extend to it is to be able to store for each file that is uploaded a textual description. The code for how it uploads the files is given at: http://the-stickman.com/web-developm...-file-element/

Thanks,

Sean


Heya,Sean。


什么你想要你的代码吗?举个例子。

你的代码是做什么的,你不想要它做什么?举个例子。

你的代码是什么*不是*它应该这样做?举个例子。
Heya, Sean.

What do you want your code to do? Give an example.
What is your code doing that you don''t want it to do? Give an example.
What is your code *not* doing that it is supposed to? Give an example.


您需要将其附加到表单/正文。你创造了它,但它留在了外太空。使用 appendChild
You need to append this to the form/body. You''ve created it, but left it hanging in outer space. Use appendChild.

>