在正在运行的项目中上传图像 [英] Image upload in running project

查看:78
本文介绍了在正在运行的项目中上传图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在运行中的hr应用程序中添加图像选项,但不成功,请帮助我
我同时发送.asp和.vb文件.......

[edit]已删除大型,格式错误和不可读的代码转储-OriginalGriff [/edit]

i Want to add image option in my running hr Application but not success please help me
i send both .asp & .vb file.......

[edit]Large, badly formatted and unreadable code dump removed - OriginalGriff[/edit]

推荐答案

答案在错误消息中:
当我上传图片而不是显示此消息时:-
The answer is in the error message:
when i upload image than show this message:-
System.Web.HttpException was unhandled by user code
  ErrorCode=-2147467259
  Message="'~/Temp/C:\Documents and Settings\Administrator\My Documents\Downloads\AGENT DIPLOMATIC CARD.jpg' is not a valid virtual path."
  Source="System.Web"


at ASP.hr_registration_scom_aspx.__RenderContent1(HtmlTextWriter __w, Control parameterContainer) in D:\SCOM\hrmanagement\hr\Registration_Scom.aspx:line 57


您错误地组装了文件名:


You are assembling the file name wrongly:

~/Temp/C:\Documents and Settings\

不是有效的路径.
看一下Registration_Scom.aspx第57行之前的行,这应该很明显.

Is not a valid path.
Look at the lines immediately before line 57 of Registration_Scom.aspx and it should be obvious.


看起来问题出在路径上.您要么指定保存图像的完整路径,要么不执行此操作.它应该相对于应用程序,或者应该是虚拟目录的路径.

或看看这个似乎

〜/Temp/C:\ Documents and Settings \ Administrator \ My Documents \ Downloads \ AGENT DIPLOMATIC CARD.jpg''

您正在尝试将文件保存在temp文件夹中,但使用完整的文件名作为要保存的文件名.不要那样做.从字符串中找到文件名,然后仅使用它.
Looks like the problem is in path. you are either specifying the full path to save the image which should not be done. it should either be relative to the application or should be the path of virtual directory.

or lookng at this it seems

~/Temp/C:\Documents and Settings\Administrator\My Documents\Downloads\AGENT DIPLOMATIC CARD.jpg''

you are trying to save file in temp folder but using the complete filename as the filename to save. dont do that. find the file name from the string and then use that only.


这篇关于在正在运行的项目中上传图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆