在C#中上传到ASP.NET [英] To Upload IN ASP.NET IN C#
本文介绍了在C#中上传到ASP.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望asp .net c#中的代码只上传jpg文件,大小为20 kb ..
SHOUTING删除 - OriginalGriff [/ edit]
I want code in asp .net c# to upload only jpg file and size 20 kb..
[edit]SHOUTING removed - OriginalGriff[/edit]
推荐答案
请参考以下链接的回答
http://stackoverflow.com/questions/12491608/asp-net-fileupload- images-only-saving-path-and-filename-in-sql-table [ ^ ]
Please refer following link''s answer
http://stackoverflow.com/questions/12491608/asp-net-fileupload-images-only-saving-path-and-filename-in-sql-table[^]
我给的例子是将图像存储在数据库中。使用这个
假设插入函数
I''m giving an example to store an image in database.Use this
suppose an insert function
insertfunction(byte[] buffer);
插入图片。
to insert a pic.
int l=uploadPhoto.PostedFile.ContentLength;
byte[] pic= new byte[l];
uploadPhoto.PostedFile.InputStream.Read(pic,0,l);
string typ = uploadPhoto.PostedFile.ContentType;
insertfunction(pic); //passing the picture buffer
任何疑问请问
any doubt plz ask
这篇关于在C#中上传到ASP.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文