Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > how to manipulate files on the server side

Reply
Thread Tools

how to manipulate files on the server side

 
 
Tim
Guest
Posts: n/a
 
      10-03-2005
I need to manipulate files (rtf and wav files) on the server side. Can you
show me how to do that?
Thank you,
 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      10-03-2005
=?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.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

 
Reply With Quote
 
 
 
 
Tim
Guest
Posts: n/a
 
      10-03-2005
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.

"Evertjan." wrote:

> =?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.
>
> --
> Evertjan.
> The Netherlands.
> (Replace all crosses with dots in my emailaddress)
>
>

 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      10-03-2005
=?Utf-8?B?VGlt?= wrote on 03 okt 2005 in
microsoft.public.inetserver.asp.general:
> "Evertjan." wrote:
>
>> =?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.


[please do not toppost on usenet]

> 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.


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)

 
Reply With Quote
 
Tim
Guest
Posts: n/a
 
      10-03-2005
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:

> =?Utf-8?B?VGlt?= wrote on 03 okt 2005 in
> microsoft.public.inetserver.asp.general:
> > "Evertjan." wrote:
> >
> >> =?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.

>
> [please do not toppost on usenet]
>
> > 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.

>
> 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)
>
>

 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      10-03-2005
=?Utf-8?B?VGlt?= wrote on 03 okt 2005 in
microsoft.public.inetserver.asp.general:

>
> "Evertjan." wrote:
>> Response.AddHeader "Content-Type", "image/Jpeg"
>>


> 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.


With the right "Content-Type" it should.

<http://reliableanswers.com/contenttype/CType.asp>

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

 
Reply With Quote
 
Tim
Guest
Posts: n/a
 
      10-05-2005
That's wonderful! Thank you for your helpful link.
Tim

"Evertjan." wrote:

> =?Utf-8?B?VGlt?= wrote on 03 okt 2005 in
> microsoft.public.inetserver.asp.general:
>
> >
> > "Evertjan." wrote:
> >> Response.AddHeader "Content-Type", "image/Jpeg"
> >>

>
> > 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.

>
> With the right "Content-Type" it should.
>
> <http://reliableanswers.com/contenttype/CType.asp>
>
> --
> Evertjan.
> The Netherlands.
> (Replace all crosses with dots in my emailaddress)
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
To manipulate or not to manipulate Dave C++ 1 01-22-2005 10:52 PM
Server-Side Control - Embedded Server-Side Code - Inline Mythran ASP .Net 2 01-22-2005 01:02 AM
client-side browser timeout OR server-side web server timeout?? (please help) jrefactors@hotmail.com Java 0 01-04-2005 04:06 AM
data synchronisation - java server side or www server side? Thor Java 1 07-02-2003 05:44 PM



Advertisments