This is my sample HTML code
<html>
<head>
<title>
fileupload
</title>
</head>
<body>
<form action="process.jag" method="post" id="" name="">
<!-- File input filed -->
<input type="file" name="myFile">
<!-- The submit button. It calls the server side function uploadfiles() on click -->
<input type="submit" id="" value="Upload File">
</form>
</body>
</html>
This is my jaggery code
<%
var verb=request.getMethod();
if (verb=='POST'){
var log = new Log();
var file = request.getFile("myFile");
file.move("C:\Users\vatsal ramesh gosar\Desktop\New folder\form\fileUploadUsingJaggery"+file.getName());
response.sendRedirect("https://www.google.com");
}
%>
It is giving a NULL Pointer Exception. Please help me solve this problem with an efficient code.
In Jaggery documentation I haven't find any way to upload image into the server. But some alternatives there...
You encode the image into base64 encoding, you may use this way too encode the images on base64
then send the encoded String using POST request using Jaggery.