You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exports.fileUpload=function(request,reply){//console.log("rawPayload: " + request.rawPayload);console.log("Received POST from "+request.payload.name+"; id="+(request.payload.id||'anon'));if(request.payload&&request.payload.uploadFile){varf=request.payload.uploadFile;console.log("uploadFile "+f.originalFilename+" ("+f.size+" bytes) at "+f.path);console.log("that you should persist to storage and remove from temp folder");// Use fs for this one: http://nodejs.org/api/fs.htmlFs.unlink(f.path,function(err){if(err)throwerr;console.log('successfully deleted '+f.path);});}reply({greeting: 'POST hello to '+request.payload.name});}
Instead of doing: if (request.payload.uploadFile) {
I am force to do: if (request.payload && request.payload.uploadFile) {
The text was updated successfully, but these errors were encountered:
When no query params are sent, request.params is null instead of {}.
My route:
My Handler:
Instead of doing:
if (request.payload.uploadFile) {
I am force to do:
if (request.payload && request.payload.uploadFile) {
The text was updated successfully, but these errors were encountered: