Sunday, 15 August 2010

c# - Image upload path not uploading in folder -



c# - Image upload path not uploading in folder -

i having problem when seek upload image on folder , click upload,the image not saved in 'uploadedfiles' folder.the 'uploadedfiles' folder still empty , not contain picture.

this project directory of saved image should go if might helps:

//c:\users\drake\documents\visual studio 2013\projects\digitalwatermarktest\digitalwatermarktest\uploadfiles

protected void btnsave_click(object sender, eventargs e) { // here upload image watermark text string filename = guid.newguid() + path.getextension(fu1.postedfile.filename); image upimage = image.fromstream(fu1.postedfile.inputstream); upimage = resizebitmap((bitmap)upimage, 400, 400);//new width using (graphics g = graphics.fromimage(upimage)) { // transparent watermark text int opacity = 128; // range 0 255 //solidbrush brush = new solidbrush(color.red); solidbrush brush = new solidbrush(color.fromargb(opacity, color.black)); solidbrush brush2 = new solidbrush(color.fromargb(opacity, color.red)); font font = new font("arial", 15); g.drawstring(txtwatermarktext.text.trim(), font, brush, new pointf(80,160)); g.drawstring(txtwatermarktext.text.trim(), font, brush2, new pointf(200, 250)); upimage.save(path.combine(server.mappath("~/uploadfiles"), filename)); image1.imageurl = "~/uploadfiles" + "//" + filename; } }

c# asp.net image-uploading

No comments:

Post a Comment