c# - How I can display Stream on the page? -
i have wcf method calling, method suppose create file create exception. try find in stream request passing method. how can alert or write stream can find content. method:
stream uploadimage(stream request) { stream requesttest = request; httpmultipartparser parser = new httpmultipartparser(request, "data"); string filepath = ""; string passed = ""; if (parser.success) { // save file somewhere //file.writeallbytes(file_path + title + file_ext, parser.filecontents); // save file //savefile( mtp.filename, mtp.contenttype, mtp.filecontents); filestream filestream = null; binarywriter writer = null; try { filepath = httpcontext.current.server.mappath("uploded\\test.jpg"); // buildfilepath(strfilename, true); filepath = filepath.replace("ssgtrnservice\\", ""); filestream = new filestream(filepath, filemode.create);
it produces error on line :
filestream = new filestream(filepath, filemode.create);
that try understand why file can not created.
given information gave, can assume code tries create file test.jpg
somewhere application not allowed write. common mistake somewhere in program files
folder. in modern windows versions, specially protected.
Comments
Post a Comment