| re: how to manipulate files on the server side
In your code, it deals with .jpg picture file. I assume it would work with
rtf and wav (sound file), too. I will check...
Again, thank you for your help. I appreciate it.
Tim.
"Evertjan." wrote:
[color=blue]
> =?Utf-8?B?VGlt?= wrote on 03 okt 2005 in
> microsoft.public.inetserver.asp.general:[color=green]
> > "Evertjan." wrote:
> >[color=darkred]
> >> =?Utf-8?B?VGlt?= wrote on 03 okt 2005 in
> >> microsoft.public.inetserver.asp.general:
> >>
> >> > I need to manipulate files (rtf and wav files) on the server side.
> >> > Can you show me how to do that?
> >> >
> >>
> >> You mean like creating, deleting, moving, copying?
> >>
> >> see the faq:
> >>
> >> "Scripting.FileSystemObject"
> >>
> >> <http://www.aspfaq.com/show.asp?id=2211>
> >> <http://www.aspfaq.com/show.asp?id=2170>
> >> etc.[/color][/color]
>
> [please do not toppost on usenet]
>[color=green]
> > Thank you for your response. No, I don't mean to creating,
> > deleting...I have rtf and wav files on the server and the users will
> > access these files. What is the code for showing the map path for them
> > to access these files? And how these files are shown up on the web
> > browser. Thank you.[/color]
>
> If they are in the scope of the www root you can just use them:
>
> <img src='/mydir/mysubdir/mypic.jpg'>
>
> if they are not, you can move them by hand.
>
> If you do not want them in he scope, you can fetch them:
>
> <img src='/mydir/fetchMe.asp'>
>
> where /mydir/fetchMe.asp is:
>
> <%
> outputJPG("mypic.jpg")
>
>
> function outputJPG(x)
>
> strFileName="c:\noScopedir\" & x
> strFilePath=server.mappath(strFilename)
>
> Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
> if objFSO.FileExists(strFilePath) then
> Set objStream = Server.CreateObject("ADODB.Stream")
> objStream.Open
>
> objStream.Type = 1
> objStream.LoadFromFile strFilePath
>
> Response.Buffer = false
> Response.ContentType = ""
> Response.AddHeader "Content-Type", "image/Jpeg"
>
> Response.BinaryWrite objStream.Read
> Response.Flush
> objStream.Close
> Set objStream = Nothing
> else
> response.write "None existing"
> end if
> Set objFSO = Nothing
>
> Response.end
> end function
> %>
>
>
>
>
> --
> Evertjan.
> The Netherlands.
> (Replace all crosses with dots in my emailaddress)
>
>[/color] |