Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Cfdirectory error... Help please!!!

New Here ,
Feb 23, 2009 Feb 23, 2009
I am trying to get a code to create a folder (ecgtemp) that is then renamed to another name (#title#) based on a variable (title): Here is the error I am getting:

The specified directory attribute C:/ColdFusion8/wwwroot/ecardia/Images/ECG/ecgtemp cannot be renamed to newdirectory C:\ColdFusion8\wwwroot\ecardia\Images\ECG\ECG Feb 23.
The exception occurred during a cfdirectory action="rename".
TOPICS
Getting started
1.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Feb 23, 2009 Feb 23, 2009
Hi,

Use the DirectoryExists function and make sure the source directory exists before renaming it.

HTH
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 24, 2009 Feb 24, 2009
Thanks Daverms. The source direcotry exists "ecgtemp". However, still getting the error. Any other ideas??
Thanks
Fareed
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 28, 2009 Feb 28, 2009
Hi Fareed,

ECG Feb 23.

Have you got spaces in the file/folder name? Perhaps that is causing some problems.

You could do a replace(filename, " ", "_") or something similar.

Chris.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 28, 2009 Feb 28, 2009
> I am trying to get a code to create a folder (ecgtemp) that is then renamed to
> another name (#title#) based on a variable (title): Here is the error I am
> getting:
>
> The specified directory attribute
> C:/ColdFusion8/wwwroot/ecardia/Images/ECG/ecgtemp cannot be renamed to
> newdirectory C:\ColdFusion8\wwwroot\ecardia\Images\ECG\ECG Feb 23.
> The exception occurred during a cfdirectory action="rename".

This could be caused by having a file within the directory you're renaming
being locked (like because it's being written to, or just open or
something).

And can you do us a favour? It's good you posted the code that's giving
you the problem, but can you pls be a bit judicious as to what code to
post? For example you've posted dozens and dozens of lines of code that's
just CSS or HTML, which couldn't *possibly* be related to your issue. And
there's dozens and dozens more lines of just comments. There's no point in
posting that stuff. There's actually only a couple of lines in there that
contributes to your problem in the slightest. Those are the only ones we
need to see.

I initially ignored your post because I refuse to wade through all that
unnecessary fluff to try to work out which bit of code might be causing the
problem.

--
Adam
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 28, 2009 Feb 28, 2009
Chris,

Thank you very much for taking the time and looking at my posting and for your suggestion.

I tried the name also without spaces but unfortunately did not work. Any other suggestions?

Fareed

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 28, 2009 Feb 28, 2009
Adam,

Your point regarding the code, although unfriendly stated, is well taken. Having said that, there are some members who kindly looked at my posting and knew what to pick up and work with.

Anyways, thanks for your suggestions. There was no file in the directory being renamed that is locked or being written to or used by other program..etc.

Any other ideas?

thanks
Fareed
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 28, 2009 Feb 28, 2009
LATEST
Problem re-posted ( code cleaned):

I am trying to get a code to create a folder (ecgtemp) that is then renamed to another name (#title#) based on a variable (title): Here is the error I am getting:

The specified directory attribute C:/ColdFusion8/wwwroot/ecardia/Images/ECG/ecgtemp cannot be renamed to newdirectory C:\ColdFusion8\wwwroot\ecardia\Images\ECG\ECG Feb 23.
The exception occurred during a cfdirectory action="rename".

Attach Code

<cfif isdefined("submit1")>

<cffile action="upload" destination="C:\ColdFusion8\wwwroot\ecardia\Images\ECG\ecgtemp" filefield="E1" nameconflict="makeunique">

<cfelseif isdefined("submit2")>

<cfquery name="getecgcolor" datasource="ecardia">
SELECT ecgcolor from colors where choice= '#level#'
</cfquery>

<cfquery name="quizset2" datasource="ecardia" >
INSERT INTO ecgquiz([title], [hx],
quote:

, , [i1], [pending], [level], [ecgcolor], [posted])
VALUES ('#title#', '#history#', '#question#','#ans...






Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources