Setting up an upload server

微笑、不失礼 提交于 2019-12-26 10:38:00

问题


I have found the server scripts repository in the documents section, but I'm having trouble getting any of them to run.

When I try the javascript file, for instance, I get numerous syntax errors, the first one being 'Expected identifier, string or number.'

I'm not much of a java whiz, so I may be missing something obvious.

This is the file I'm trying to use: https://github.com/Widen/fine-uploader-server/blob/master/java/MultipartUploadParser.java


回答1:


Looking at the js code, two lines are tripping errors

console.log('>> Node.js server listening on port: ' app.get('port'));

should that not be

console.log('>> Node.js server listening on port: ' + app.get('port'));

and

}

// The endpoint for uploads
app.post("/uploads", function (req, res, next) {

should that not be

});

// The endpoint for uploads
app.post("/uploads", function (req, res, next) {

simply copying and pasting the example server.js and running it in node does not work...

once those two changes are made, node gives an error cannot find module 'express'

Edit - express install -g doesn't work. had to use npm install express now getting error

app.configure(function....

app is not defined - line 14




回答2:


In order to handle requests from Fine Uploader, your server must properly parse multipart encoded POST requests at a minimum. It looks like you have chosen Java, and the Java server-side examples. You will need to setup a web server (using Tomcat or Jetty for instance) and include all three example files. The MultipartUploadParser, which parses the MPE request, the RequestParser, which reads Fine Uploader specific data in the request, and UploadReceiver, which contains most of the upload handling logic.



来源:https://stackoverflow.com/questions/21261295/setting-up-an-upload-server

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!