Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics 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 August 7th, 2003, 06:06 AM
Authorized User
 
Join Date: Aug 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ells228
Default Dynamic Folder Creation

Hi,
I have recently completed this bit of code and wanted to share it with you.

I have a property site that has images associated with each property and i wanted some code that created a folder on the server whilst creating a new record in the DB.

This is what I did :


<%
dim szValues
PropFolder = request.form("GetPropRef")
szValues = "'" & Request.Form("GetPropRef") &_
         "', '"& Request.Form("GetDisplayRef") &_
         "', '"& Replace(Request.Form("GetRightText"),"'","`") &_
         "', '"& Replace(Request.Form("GetBottomText"),"'","`") &_
         "', '"& Replace(Request.Form("GetText3"),"'","`") &_
         "', '"& Request.Form("GetMainPictureURL") &_
         "', '"& Request.Form("GetPicture1URL") &_
         "', '"& Request.Form("GetPicture2URL") &_
         "', '"& Request.Form("GetPicture3URL") &_
         "', '"& Request.Form("GetActive") &_
         "', '"& request.form("GetPropType") &_
         "', '"& request.form("GetPrice") &_
         "', '"& request.form("GetBeds") &_
         "', '"& request.form("GetBaths") &_
         "', '"& "No" &_
     "'"

      strsql = "INSERT INTO Properties ( PropertyRef, DisplayRef, RightText, BottomText, Text3, MainPictureURL, Picture1URL, Picture2URL, Picture3URL, Active, PropType, Price, Beds, Baths, Deleted ) VALUES(" &_
         szValues & ")"

  rsuser.open strsql,conn,1,2
'response.write szValues
%>

<%
'CreateFolder
   Dim fso, fldr

   Set fso = CreateObject("Scripting.FileSystemObject")

   If FSO.FolderExists(Server.MapPath("../images/properties/" & PropFolder)) Then
   response.redirect "newpropicons.asp?property=" & Request.Form("GetPropRef")
   Else
   Set fldr = fso.CreateFolder(Server.MapPath("../images/properties/" & PropFolder))
   response.redirect "newpropicons.asp?property=" & Request.Form("GetPropRef")
   End If
%>
__________________
Cheers,
C.

Chris Ellis
Icon-Business Ltd
www.icon-business.net
[email protected]





Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic page creation DyerOppenheimer BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 June 29th, 2009 05:34 PM
dynamic textbox creation badamsreekar ASP.NET 2.0 Professional 1 July 26th, 2007 10:40 AM
How to avoid automatical creation of debug folder? tennis.music Xcode 0 December 12th, 2006 05:59 PM
Regarding Bin folder creation in ASP.NET 2.0 param99 ASP.NET 2.0 Professional 4 September 5th, 2006 07:29 AM
Regarding Bin folder creation in ASP.NET 2.0 param99 ASP.NET 2.0 Basics 0 September 5th, 2006 06:45 AM





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