R
Robb Meade
Hi all,
I've written a small form handler script which should work for 'all' (term
used loosely) forms...
It will email the company, send courtesy emails to the form filler and save
data to a text file - all with various options made easy by changing hidden
tags in the form.
One minor problem I've come across is that I need to be able to write to a
specific directory on the server.
So lets say I allow a hidden tag for the owner of the server to enter the
name of the directory they want to write to, lets call it 'data'.
When I use the Server.Mappath('data') in this scenario, it looks within the
same directory, as a result it does not find the directory, and then my
script creates one.
The actualy directory (in the current case) is say one level above (../
etc), but I dont know that that is always going to be the case.
I'd rather not have to put the script in the root level of the web for this
to always work, as for frontpage users for example they may have subwebs and
so on, but the data folder could well be in the main root directory.
So, how can I ensure that using the Server.Mappath('data') find the 'data'
folder at the root level.
I appreciate on my setup here I could simply enter the full path, ie,
E:\webs\webdev\some-client\data but I need 'joe public' to be able to enter
just the name of the directory (or use the default of 'form-data' or
something), and have it written to the correct place.
Anybody got any ideas/suggestions?
Thanks in advance for any help,
Regards
Robb Meade
I've written a small form handler script which should work for 'all' (term
used loosely) forms...
It will email the company, send courtesy emails to the form filler and save
data to a text file - all with various options made easy by changing hidden
tags in the form.
One minor problem I've come across is that I need to be able to write to a
specific directory on the server.
So lets say I allow a hidden tag for the owner of the server to enter the
name of the directory they want to write to, lets call it 'data'.
When I use the Server.Mappath('data') in this scenario, it looks within the
same directory, as a result it does not find the directory, and then my
script creates one.
The actualy directory (in the current case) is say one level above (../
etc), but I dont know that that is always going to be the case.
I'd rather not have to put the script in the root level of the web for this
to always work, as for frontpage users for example they may have subwebs and
so on, but the data folder could well be in the main root directory.
So, how can I ensure that using the Server.Mappath('data') find the 'data'
folder at the root level.
I appreciate on my setup here I could simply enter the full path, ie,
E:\webs\webdev\some-client\data but I need 'joe public' to be able to enter
just the name of the directory (or use the default of 'form-data' or
something), and have it written to the correct place.
Anybody got any ideas/suggestions?
Thanks in advance for any help,
Regards
Robb Meade