Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 9th, 2005, 07:28 AM
Authorized User
 
Join Date: Feb 2005
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kumarop
Default create folder

Dear all,
Please find time to reply some of my doughts.

1) I want to create folder if it is not found. It seems it is not working. I am getting error

Microsoft VBScript runtime error '800a004c'
Path not found

Cannot I make folder in any drive say c or d (both are present)? Do it involve some grsnt issue?

b) For putting file in folder write grant on folder must be given to internet user.can permission of write on this folder to Internet user be given by asp code(after varification)?

Code:
Set fs=Server.CreateObject("Scripting.FileSystemObject")
                If fs.FolderExists("d:\temp\email") = true Then
                'Response.Write("Folder c:\temp exists.")
                Else
                set f=fs.CreateFolder("d:\temp\email")
                set f=nothing
                End If
                set fs=nothing
regards

om prakash kumar
__________________
om prakash kumar
 
Old April 10th, 2005, 03:12 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I think the problem is probably caused by the fact that d:\Temp does also not exist. The CreateFolder of the FSO object only creates the latest folder in the path; all others must exist ir the method will fail.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old April 11th, 2005, 01:51 AM
Authorized User
 
Join Date: Feb 2005
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kumarop
Default

Thanks Imar,
   But what is the solution,if I want to create folder inside the folder through asp? also how to give grant on the same?

regards
om prakash

om prakash kumar
 
Old April 11th, 2005, 02:38 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You'll need to parse the folder name, and then check and create each of the parts.

E.g. break apart C:\temp\email into C:\temp and C:\temp\email, then first check if C:\temp exists, and if necessary create it.

Don't know about setting permissions. It will inherit settings of the base folder, so if that's enough for you, set the settings on the parent (e.g. on C:\temp; setting it on c:\ doesn't sound like a good idea to me).

There may be third party controls that allow you to set permissions though.....

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Fun For Me by Moloko (Track 1 from the album: Do You Like My Tight Sweater?) What's This?





Similar Threads
Thread Thread Starter Forum Replies Last Post
create folder abaso.jadhav01 ASP.NET 1.0 and 1.1 Basics 0 October 27th, 2006 09:25 AM
Create Folder jezywrap VBScript 1 October 11th, 2006 02:40 PM
How to Create new folder(directory) in Srever ? Raam ASP.NET 2.0 Professional 1 May 10th, 2006 12:48 PM
How to create a folder in server and rename files pramos.21d ASP.NET 2.0 Basics 0 April 24th, 2006 05:27 AM
How can i create a folder? chipset VB How-To 2 July 28th, 2004 05:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.