While this is just a demo and my backend team has not yet started, I would like to save the file to a specific folder within my project (I do not want to save it in the database).
All I want is that when I upload a file and click on the upload button, that file should be copied to a particular folder within the project. This process should be done using AngularJS or JavaScript only, without any backend scripting (e.g. PHP, JAVA, etc).
I have tried the following code snippets, but I am not getting a 404: PATH NOT FOUND error for the folder where I want to upload.
Examples I've Tried:
myApp.controller('myCtrl', ['$scope', 'fileUpload', function($scope, fileUpload){
$scope.uploadFile = function(){
var file = $scope.myFile;
console.log('file is ' );
console.dir(file);
var uploadUrl = "/fileUpload";
fileUpload.uploadFileToUrl(file, uploadUrl);
};
}]);
https://jsfiddle.net/JeJenny/ZG9re/
http://jsfiddle.net/danialfarid/maqbzv15/1118/
Please provide some suggestions.