2014-04-24 19 views
1

我工作的PhoneGap,我需要上传的文件,并添加所有文件名入参数,可以这样:网址未显示用户选择的所有文件?

http://www.example.com/uplaod.html?file=file1,file2,file3

对于我正在尝试这样的:

function new_page() 
{ 
    var file3=document.getElementById('my_file'); 
    var data_file=document.getElementById('file_handle').innerHTML; 
    if(file3!=null) 
    { 
    var file=document.getElementById('my_file').innerHTML; 
    file+=data_file; 
    window.location.href='job_posting.html?file='+file; 
    } 
    else 
    { 
    window.location.href='job_posting.html'; 
    } 
} 

当我上传多个文件,那么它创建只有第一个文件的链接,我选择:

像:

http://www.example.com/upload.html?file=file

但它应该是

http://www.example.com/uplaod.html?file=file1,file2,file3

+0

你使用什么web服务器?它是Apache吗? – iamsleepy

+1

@iamsleepy有没有服务器真正的问题? – Simmant

+0

@simmant,由于重写错误,我偶然发现了类似的东西。可能有关系,也可能不相关。 – iamsleepy

回答

0

我将收集的其他文件作为一个数组,并解析其中的URL作为一个JSON字符串。

然后使用php json_decode