Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create Folder

Status
Not open for further replies.

discusmania

IS-IT--Management
Oct 24, 2000
158
AP
Hi all,
I want the visitor of my web page able to create a folderin my server and get a read and write permission to the folder. The application is in the intranet. When the folder was created the user are free to store any files in the folder. The process of storing file is a normal process,which do not involve any programming like dragging from their hard disk to the server space. I want as simple program as possible. Actually the process is only creating the folder. does anyone have any idea?

thanks and regards,
NOR
 
Hello!
I hope that will help:

On client side form :
<form action=some.asp method=post name=form1 >
Enter Your Folder Name Here:
<input type=&quot;text&quot; name=&quot;FolderName&quot;><br>
<input type=&quot;button&quot; value=&quot;Submit&quot; onclick=&quot;checkInPut();&quot; name=button1>
<input type=&quot;Reset&quot;>
</form>
<script language=javascript>
function checkInPut()
{
if (form1.FolderName.value!=&quot;&quot;)
{
if ( form1.FolderName.value.indexOf(&quot;/&quot;)==-1 )// add any characters in the same way here
form1.submit();
else
alert(&quot;Invalid character in folder name!&quot;);
}
else
alert(&quot;Enter a name!&quot;);
}
</script>

and some.asp page:
<%
dim fso, f
dim sPath
sPath = &quot;Folder Location\&quot; ' example: &quot;c:\&quot;
if Request.Form(&quot;FolderName&quot;) then
Set fso = CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set f = fso.CreateFolder(sPath &amp; Request.Form(&quot;FolderName&quot;))
Response.Redirect(&quot;someURL&quot;)
else
Response.Redirect(&quot;someotherURL&quot;)
end if
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top