javascript - Uploading image to server gives "URI formats are not supported." exception -
i have wcf service function upload images below:
public function upload(uploading stream) uploadedfile implements iservice.upload dim strpath string = io.path.getdirectoryname(system.reflection.assembly.getexecutingassembly.codebase) dim upload__1 new uploadedfile() { .filepath = path.combine(strpath & "/pps/", guid.newguid().tostring()) } strpath = new uri(strpath).localpath dim length integer = 0 using writer new filestream(upload__1.filepath, filemode.create) dim readcount integer dim buffer = new byte(8191) {} while (inlineassignhelper(readcount, uploading.read(buffer, 0, buffer.length))) <> 0 writer.write(buffer, 0, readcount) length += readcount end while end using upload__1.filelength = length return upload__1 end function
i added line: strpath = new uri(strpath).localpath
in attempt solve problem suggested many posts, did not work. call function javascript function code:
request.open('post', 'http://localhost:55288/serviceapiserver.svc/upload/'); request.setrequestheader("x-filename",id + ".jpeg"); request.send(imageuri);
the imageuri of form: "blob:http%3a//localhost%3a5232/04dhg421-3jd45-3hj-926f-8d" i'd wcf function save image file name received (i.e id + ".jpeg"). please guide done here.
Comments
Post a Comment