【发布时间】:2015-10-14 05:49:27
【问题描述】:
我有一种情况:我正在使用 https://www.playframework.com/documentation/2.0/JavaFileUpload 在某个服务器位置上传一个文件,
//上传文件:
<input type="file" name="fileUpload">
<input type="submit" value="Upload">
从下面的代码中,我正在上传上面上传的文件并在我的视图页面上获取/显示它(点击提交按钮后):
<input type="file" id="inputfile">
<input type="button" value="Submit" id="submitfile">
jQuery:
$("#submitfile").click(function(){
var path1 =$('input[type=file]').val().replace(/C:\\fakepath\\/i, '');//uploaded file names
//adding the Play framework server path for Application to get the image(s) file(s) path
var filespath = '/files/images/'+path1;//giving my uploaded files path here
});
但我的要求是:我只需要一种类型:在服务器位置接受/上传文件并在我的视图页面上从服务器位置返回/显示相同的文件路径?我正在为此而奋斗。请帮帮我。
【问题讨论】:
标签: javascript jquery html playframework