Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 5th, 2008, 04:28 PM
Authorized User
 
Join Date: Jan 2006
Location: gangtok, Sikkim, India.
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
  #2 (permalink)  
Old July 7th, 2008, 07:18 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 10: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



All times are GMT -4. The time now is 12:57 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.