AnsweredAssumed Answered

File upload web script not running javascript

Question asked by sihnu on Mar 23, 2015
Hi all,

recently I implemented file upload web service following these instructions https://wiki.alfresco.com/wiki/Web_Scripts_Examples#Upload_Script. I got it working fine. Then I wanted to try out some experiments. I want to return json instead of html. So I changed the enctype of the form to application/json, added format=json to upload.post.desc.xml, renamed javascript to upload.post.json.js and tried to run the webscript. Javascript file wasn't ran. Quickly I discovered that you can't set enctype to application/json in HTML form. I tried to use Javascript to parse the filedata from the form and do ajax request but I ran to different problems until I decided to return back where I started.

The thing is that even I renamed my files back to original, removed all the changes I had made and refreshed the webscripts at my server, the webscript is till not running my javascript file. I even removed the files, stopped Alfresco, emptied /temp and /work folders, cleared the cache at webscript service index and reuploaded all the files. Still the javascript is not ran.I don't know what to do anymore. Has anyone else encountered similar problem? I don't understand why my webscript is not running the javascript even though it used to run it earlier just fine.

Thanks in advance

<strong>edit: </strong>oops… I had not renamed the javascript file even though I was so sure I did. What a shame. I thought I checked the names multiple times. I think I screwed the naming some way that the changed didn't come in place. Sorry, luckily I noticed this very soon so I hope nobody has been wondering what is going on here. Marking this post as solved <strong>facepalm</strong>.

Outcomes