当图像向上倾斜时,它可以..................................................... .. [英] while am uploding image it can..............................................
本文介绍了当图像向上倾斜时,它可以..................................................... ..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在向上转换图像时,它可以显示在文件夹中,但是我必须从数据库中查看
while am uploding image it can showing in folder but i have to view from Database
if (fileup.HasFile)
{
file = fileup.FileName;
bool ans = checkFileExtension(file);
if (ans)
{
try
{
fileadd = (Server.MapPath("Image\\") + txtMulShortName.Text + "." + file.Substring(file.LastIndexOf(".") + 1).ToString());
fileup.SaveAs(fileadd);
}
catch (Exception ex) { }
locLogo.ImageUrl = "~/Image/" + txtMulName.Text + "." + file.Substring(file.LastIndexOf(".") + 1).ToString();
}
else
{
msgmulliteral.Text = "Invalid file type of Logo, select only JPG files";
}
}
推荐答案
然后,您需要更改软件以将图像存储在数据库中,或将图像的路径存储在DB中-它取决于您的数据库及其中的字段定义.
目前,您只需编写代码即可将图像保存到服务器上的文件中.
Then you either need to change your software to store the image in a database, or to store the path to the image in the DB - it depends on your database and the field definition in it.
At the moment, you code just saves the image to a file on the server.
这篇关于当图像向上倾斜时,它可以..................................................... ..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文