如何通过Web方式上传网页同时将网页的相关图片也上传到服务器上?

fanshuyi 2004-10-14 04:42:24
如何通过Web方式上传网页同时将网页的相关图片也上传到服务器上?


是一套信息管理系统,用户采用Web页面作后台管理。希望将Word生成的html页面直接上传的服务器然后欠套在网页中。要求上传单个网页的时候将相关的图片也上传上去,并能正常显示。
...全文
294 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
fanshuyi 2004-10-18
  • 打赏
  • 举报
回复
非常感谢bimyboy(★浩天雪狐★) 已经搞定
明珠佩佩 2004-10-14
  • 打赏
  • 举报
回复
asp处理 word文档经常遇到权限问题,参考
http://support.microsoft.com/default.aspx?scid=kb;zh-cn;288366
http://support.microsoft.com/kb/288367/EN-US/
http://support.microsoft.com/kb/288367/zh-cn

帮你找的,看看行不??
明珠佩佩 2004-10-14
  • 打赏
  • 举报
回复
Option Explicit

'declare all variables
Dim objWord
Dim oDoc
Dim objFso
Dim colFiles
Dim curFile
Dim curFileName
Dim folderToScanExists
Dim folderToSaveExists
Dim objFolderToScan

'set some of the variables
folderToScanExists = False
folderToSaveExists = False
Const wdSaveFormat = 10 'for Filtered HTML output

'********************************************
'change the following to fit your system
Const folderToScan = "C:\Word\documentation\"
Const folderToSave = "C:\Inetpub\wwwroot\word\"
'********************************************

'Use FSO to see if the folders to read from
'and write to both exist.
'If they do, then set both flags to TRUE,
'and proceed with the function
Set objFso = CreateObject("Scripting.FileSystemObject")
If objFso.FolderExists(folderToScan) Then
folderToScanExists = True
Else
MsgBox "Folder to scan from does not exist!", 48, "File System Error"
End If
If objFso.FolderExists(folderToSave) Then
folderToSaveExists = True
Else
MsgBox "Folder to copy to does not exist!", 48, "File System Error"
End If

If (folderToScanExists And folderToSaveExists) Then
'get your folder to scan
Set objFolderToScan = objFso.GetFolder(folderToScan)
'put al the files under it in a collection
Set colFiles = objFolderToScan.Files
'create an instance of Word
Set objWord = CreateObject("Word.Application")
If objWord Is Nothing Then
MsgBox "Couldn't start Word.", 48, "Application Start Error"
Else
'for each file
For Each curFile in colFiles
'only if the file is of type DOC
If (objFso.GetExtensionName(curFile) = "doc") Then
'get the filename without extension
curFileName = curFile.Name
curFileName = Mid(curFileName, 1, InStrRev(curFileName, ".") - 1)
'open the file inside Word
objWord.Documents.Open objFso.GetAbsolutePathName(curFile)
'do all this in the background
objWord.Visible = False
'create a new document and save it as Filtered HTML
Set oDoc = objWord.ActiveDocument
oDoc.SaveAs folderToSave & curFileName & ".htm", wdSaveFormat
oDoc.Close
Set oDoc = Nothing
End If
Next
End If
'close Word
objWord.Quit
'set all objects and collections to nothing
Set objWord = Nothing
Set colFiles = Nothing
Set objFolderToScan = Nothing
End If

Set objFso = Nothing
surferc 2004-10-14
  • 打赏
  • 举报
回复
直接上传doc不成?一样能在IE里打开啊。要不然你就叫他把html另存成mht,这样图形资源都打在mht里面直接上传就成了。
fanshuyi 2004-10-14
  • 打赏
  • 举报
回复
没人看 自己顶 帮帮忙啦

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧