I am kinda stuck right now. My VB script doesn't read the image blob, or does not get the file. I hope you can all help. Here is my code.
The image here is already in base64 and already being converted to blob and added to a form
var blob = dataURItoBlob(final_image.src);
var formData = new FormData();
formData.append("objFile", blob, "image.jpeg");
$.ajax({
url: 'UploadImage/ ImageFunction',
data: { IDName: sessionStorage.IDName, CanvasImage: formData },
cache: false,
processData: false,
contentType: false,
type: 'POST'
});
As you can see it here, it now being sent to the vb script. THe problem is that it doesnt read the blob file and doesnt save.
Function ImageFunction()
Dim directory As String
Dim objFile As HttpPostedFileBase = Request.Files("objFile")
Dim counter As Integer = Request.Files.Count
If Not System.IO.Directory.Exists("temp\Pictures") Then
IO.Directory.CreateDirectory("temp\Pictures")
End If
directory = "temp\Pictures\"
If Not System.IO.Directory.Exists(directory & Common.WebRequest.Data("IDName")) Then
IO.Directory.CreateDirectory(directory & Common.WebRequest.Data("IDName"))
End If
If (Not objFile Is Nothing) Then
objFile.SaveAs(directory & Common.WebRequest.Data("IDName") & "\" & Common.WebRequest.Data("IDName") & ".jpg")
End If
End Function
Can someone lighten me if where have I gone wrong?