469,898 Members | 1,710 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

Just wondering

Just wondering if it would be possible to convert an existing e-mail form
to;

1. Send the e-mail (as it does now...without problems)
2. Copy one folder on the server, to another new folder

Using the username from the e-mail form, as the new foldername?

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)

Jul 19 '05 #1
11 2069
As long as you have access to the ASP file that's doing these things, sure,
why not?

Ray at work

"Steven Burn" <nobody@PVT_it-mate.co.uk> wrote in message
news:Oh**************@TK2MSFTNGP10.phx.gbl...
Just wondering if it would be possible to convert an existing e-mail form
to;

1. Send the e-mail (as it does now...without problems)
2. Copy one folder on the server, to another new folder

Using the username from the e-mail form, as the new foldername?

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)

Jul 19 '05 #2
Cheers Ray.

I'm just doing a quick search on aspfaq.com to see if I can find any info
(it not only has to copy the folder, but all contents, including
sub-folders..... which is proving to be a nightmare when using the
Server.MapPath string).

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
Ray at <%=sLocation%> <myfirstname at lane34 dot com> wrote in message
news:u3**************@TK2MSFTNGP09.phx.gbl...
As long as you have access to the ASP file that's doing these things, sure, why not?

Ray at work

"Steven Burn" <nobody@PVT_it-mate.co.uk> wrote in message
news:Oh**************@TK2MSFTNGP10.phx.gbl...
Just wondering if it would be possible to convert an existing e-mail form to;

1. Send the e-mail (as it does now...without problems)
2. Copy one folder on the server, to another new folder

Using the username from the e-mail form, as the new foldername?

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)


Jul 19 '05 #3
Below is the code I am trying to use to copy the folder; (constantly gives
"file not found")

'BEGIN CODE

Dim FSO
Dim fldr
Dim strName
strName = Trim(Request.Form("username"))

Set FSO = CreateObject("Scripting.FileSystemObject")

'Doesn't seem to work either
' If FolderExists(Server.MapPath("\htdocs\users\") & strName) = True Then

If FolderExists(Server.MapPath("users\") & strName) = True Then
Response.Redirect "error.asp"
Else
Set fldr = FSO.CopyFolder(Server.MapPath("temp"),
Server.MapPath("users\") & strName)
End If

'Originally VB code, but tried to convert it to work with ASP aswell (not
sure if it works due to the above issue)
Public Function FolderExists(sFileName)
If IsNothing(sFileName) Then
FolderExists = False
Exit Function
End If
If Len(FSO.GetFolder(sFileName)) Then
FolderExists = True
Else
FolderExists = False
End If
End Function

Public Function IsNothing(sWhat)
If Len(Trim(sWhat)) = 0 Then
IsNothing = True
Else
IsNothing = False
End If
End Function

Set FSO = Nothing
Set fldr = Nothing

'END CODE

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
Steven Burn <nobody@PVT_it-mate.co.uk> wrote in message
news:Oh**************@TK2MSFTNGP10.phx.gbl...
Just wondering if it would be possible to convert an existing e-mail form
to;

1. Send the e-mail (as it does now...without problems)
2. Copy one folder on the server, to another new folder

Using the username from the e-mail form, as the new foldername?

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)

Jul 19 '05 #4
> Set fldr = FSO.CopyFolder(Server.MapPath("temp"),
Server.MapPath("users\") & strName)


CopyFolder takes a destination folder, not the name you want it to take.
Also, there is nothing to assign to the results. Try the following:

FSO.CopyFolder Server.MapPath("temp"), Server.MapPath("users/")

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
Jul 19 '05 #5
The CopyFolder method of the FSO copies contents. See here.
http://msdn.microsoft.com/library/en...CopyFolder.asp

Ray at work
"Steven Burn" <nobody@PVT_it-mate.co.uk> wrote in message
news:uH**************@TK2MSFTNGP09.phx.gbl...
Cheers Ray.

I'm just doing a quick search on aspfaq.com to see if I can find any info
(it not only has to copy the folder, but all contents, including
sub-folders..... which is proving to be a nightmare when using the
Server.MapPath string).

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
Ray at <%=sLocation%> <myfirstname at lane34 dot com> wrote in message
news:u3**************@TK2MSFTNGP09.phx.gbl...
As long as you have access to the ASP file that's doing these things,

sure,
why not?

Ray at work

"Steven Burn" <nobody@PVT_it-mate.co.uk> wrote in message
news:Oh**************@TK2MSFTNGP10.phx.gbl...
Just wondering if it would be possible to convert an existing e-mail form to;

1. Send the e-mail (as it does now...without problems)
2. Copy one folder on the server, to another new folder

Using the username from the e-mail form, as the new foldername?

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)



Jul 19 '05 #6
So, if you need it to take on strName, I think you will need to use
MoveFolder method after it has been copied.

Or, just use the MoveFolder method, and then CreateFolder to rebuild the
temp folder, I guess...

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
Jul 19 '05 #7
http://msdn.microsoft.com/library/de...us/script56/ht
ml/jsmthFolderExists.asp

I've got the following to create the folder, no problem. However, I am
having a problem.

First of all, I tried the FolderExists code at MSDN (see URL above), to try
and get it to re-direct to error.asp if the folder exists, but it doesn't
appear to work. Anyone have any ideas on how to convert the below to check
if the folder exists, and if it does, re-direct it to the error.asp page?

'BEGIN CODE
Dim FSO
Dim fldr
Dim strName
strName = Trim(Request.Form("username"))
Set FSO = CreateObject("Scripting.FileSystemObject")

ReportFolderStatus Server.MapPath("users" & "\" & strName)

Function ReportFolderStatus(fldr)
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FolderExists(fldr)) Then
response.redirect "error.asp"
Else
Set fldr = FSO.CreateFolder(Server.MapPath("users" & "\" & strName))
FSO.CopyFolder Server.MapPath("temp"), fldr.Path
End If
ReportFolderStatus = msg
End Function

Set FSO = Nothing
Set fldr = Nothing

'END CODE

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
Steven Burn <nobody@PVT_it-mate.co.uk> wrote in message
news:Oh**************@TK2MSFTNGP10.phx.gbl...
Just wondering if it would be possible to convert an existing e-mail form
to;

1. Send the e-mail (as it does now...without problems)
2. Copy one folder on the server, to another new folder

Using the username from the e-mail form, as the new foldername?

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)

Jul 19 '05 #8
> If (fso.FolderExists(fldr)) Then

Come on now, where do you define fldr? What happens when you do

response.write "fldr = " & fldr: response.end

?

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
Jul 19 '05 #9
ReportFolderStatus Server.MapPath("users" & "\" & strName) 'fldr path and
name

When doing a Response.Write on the above (fldr), it shows the path as it
should be, without any problems.

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
Aaron Bertrand - MVP <aa***@TRASHaspfaq.com> wrote in message
news:eT**************@TK2MSFTNGP12.phx.gbl...
If (fso.FolderExists(fldr)) Then


Come on now, where do you define fldr? What happens when you do

response.write "fldr = " & fldr: response.end

?

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/

Jul 19 '05 #10
> ReportFolderStatus Server.MapPath("users" & "\" & strName) 'fldr path and
name

When doing a Response.Write on the above (fldr), it shows the path as it
should be, without any problems.


You're confusing me. The above is not represented anywhere by the variable
named fldr ...

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
Jul 19 '05 #11
Thanks everyone but...... I've solved it (for now). Modified the code to the
below;

'BEGIN CODE
Dim FSO
Dim fldr
Dim strName
strName = Trim(Request.Form("username"))

If ReportFolderStatus(Server.MapPath("users" & "\" & strName)) = "1" Then
Response.Redirect "error.asp"
Else
Set fldr = FSO.CreateFolder(Server.MapPath("users" & "\" & strName))
FSO.CopyFolder Server.MapPath("temp"), fldr.Path
End If

Function ReportFolderStatus(fldr)
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FolderExists(fldr)) Then
msg = "1" 'True
Else
msg = "0" 'False
End If
ReportFolderStatus = msg
End Function

Set FSO = Nothing
Set fldr = Nothing

'END CODE
--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
Steven Burn <nobody@PVT_it-mate.co.uk> wrote in message
news:OZ**************@tk2msftngp13.phx.gbl...
http://msdn.microsoft.com/library/de...us/script56/ht ml/jsmthFolderExists.asp

I've got the following to create the folder, no problem. However, I am
having a problem.

First of all, I tried the FolderExists code at MSDN (see URL above), to try and get it to re-direct to error.asp if the folder exists, but it doesn't
appear to work. Anyone have any ideas on how to convert the below to check
if the folder exists, and if it does, re-direct it to the error.asp page?

'BEGIN CODE
Dim FSO
Dim fldr
Dim strName
strName = Trim(Request.Form("username"))
Set FSO = CreateObject("Scripting.FileSystemObject")

ReportFolderStatus Server.MapPath("users" & "\" & strName)

Function ReportFolderStatus(fldr)
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FolderExists(fldr)) Then
response.redirect "error.asp"
Else
Set fldr = FSO.CreateFolder(Server.MapPath("users" & "\" & strName)) FSO.CopyFolder Server.MapPath("temp"), fldr.Path
End If
ReportFolderStatus = msg
End Function

Set FSO = Nothing
Set fldr = Nothing

'END CODE

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
Steven Burn <nobody@PVT_it-mate.co.uk> wrote in message
news:Oh**************@TK2MSFTNGP10.phx.gbl...
Just wondering if it would be possible to convert an existing e-mail form to;

1. Send the e-mail (as it does now...without problems)
2. Copy one folder on the server, to another new folder

Using the username from the e-mail form, as the new foldername?

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)


Jul 19 '05 #12

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by rodchar | last post: by
16 posts views Thread by rodchar | last post: by
8 posts views Thread by rodchar | last post: by
2 posts views Thread by DoomedLung | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.