问题
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