Wrox Programmer Forums
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional 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 July 5th, 2008, 03:28 PM
Authorized User
 
Join Date: Jan 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default mapped folder is deleted

Hi,

   i am trying to delete a temp folder(which stores copies of attachments) as soon as a mail is sent. the problem is the original attachments are kept in another machine(directory is mapped). When i execute the code locally, the folder is deleted and the app works perfectly. However, when i deploy the app(on another machine) and perform the same function, the path to the mapped directory is deleted. Can somebody help me out with this. The code that i have written to delete the temp folder(in which the attachment copies are kept) is as follows:

the attachments are deleted once the email is sent(that works properly)

tempfolder =Request.PhysicalApplicationPath + "Foldername";

Directory.Delete(tempfolder,true);



achhetri
__________________
achhetri
 
Old July 7th, 2008, 06:18 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Quote:
quote:Originally posted by @shish
 When i execute the code locally, the folder is deleted and the app works perfectly. However, when i deploy the app(on another machine) and perform the same function, the path to the mapped directory is deleted.

What you've written here is a little confusing. Are you saying that when on the local machine, the delete action succeeds? And when you run on the remote machine that the delete action fails? Are you saying that on the remote machine the path to the mapped directory does not exist?

Mapped drives are tricky. Usually the drive mapping is specific to the logged on user. If you log on then map a drive, the operating system doesn't see the mapped drive outside of the user context. So if you have a site running in IIS, it won't see the drive letter. I have tried in the past to set up drive mappings on the system level and I didn't have any success. Can you access the network location with an UNC address (\\machineName\shareName\dir\dir...)?

-Peter
compiledthoughts.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Retriving UNC Path of mapped drive (Linux Folder) kaushalparik ASP.NET 2.0 Professional 2 April 5th, 2007 09:58 PM
Can't detect a mapped drive in ASP Reese_Kirsten ASP.NET 1.0 and 1.1 Basics 2 December 1st, 2006 02:46 AM
mapped drive khansa PHP How-To 0 February 23rd, 2006 07:46 AM
mapped drive khansa PHP How-To 0 February 23rd, 2006 07:43 AM
Mapped drive khansa MySQL 1 February 23rd, 2006 05:38 AM





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