Creating a directory before using cffile

I'm having trouble using cffile right before I create a directory. I am using the cffileupload tag and my url attribute is a page that has the following code. Basically the code below creates a new directory and uploads all the images to that directory. However, it fails on the 2nd upload and i get a 500 error in the cffileupload flash object. However, if I hardcode the directory path, they all upload fine. Anyone know why I am having this problem?
<!--- User will upload all the images to a temp directory based on date and time --->
<cfset uploadFolderPath = "C:\ColdFusion9\wwwroot\MyApplication\uploads\" />
<cfset date=DateFormat(Now(),'mm-dd-yyyy_') />
<cfset time=TimeFormat(Now(),'hh-mm-ss') />
<cfset newFolderName = "upload_" & date & time />
<cfset newFolder = uploadFolderPath & newFolderName />
<cfdirectory action = "create" directory="#newFolder#" />
<cffile action="uploadall" destination="#newFolder#" nameconflict="makeunique" />

It seems unlikely to be your problem, but be aware that <cffileupload> calls that URL once for each file uploaded, not just once.  That means the <cfdirectory> could conceivably be called twice within the same second, meaning the second call to it might fail because the dir already exists.
You should probably check the dir exists before just assuming you're OK to create it.
Adam

Similar Messages

  • Does we need to Create a file Before using Open dataSet

    Hi Guys,
                Can  any body tell me whether we have to create a File before using Open dataset  for writing files in Application Server.
               Can anybody write a program for EKPO table to store it in application Server using OpendatasSet ?Is there any specific care we have to take for Executing   pgm in Background?
    I wrote the pgm for Foreground using GUI- Download.
    PGM.
          select * into table it_ekpo  from  ekpo .
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    filename ='c:\EKPO.xls'
    filetype = 'ASC'
    WRITE_FIELD_SEPARATOR = 'X'
    TABLES
    data_tab = it_ekpo
    *fieldnames = l_heading
    EXCEPTIONS
    file_write_error = 1
    no_batch = 2
    gui_refuse_filetransfer = 3 .
                       Plzzzzzzzzz Make the changes for existing Pgm.any help is awarded with points.Its Urgent.
    Thanks,
    Gopi.

    Hi Guys,
                 Thanks for ur immediate response.I am sending the code just confirm me whether is correct r not?
    DATA : wa_EKPO_file   TYPE file_table-filename.
    select * into table it_ekpo  from  ekpo .
      OPEN DATASET wa_EKPO_file FOR OUTPUT         "Write to appl. server
                                          IN TEXT MODE
                                          ENCODING DEFAULT.  "Open dataset Return code
    IF sy-subrc = 0.
    LOOP at IT_EKPO into WA_EKPO.
    TRANSFER wa_ekpo to wa_ekpo_file.
    ENDLOOP.
    ENDIF.
                                             I want write the data into SPREAD Sheet .Can u guys  tell me how to write into Spread Sheet using Open data Set.
    Thanks,
    Gopi.

  • On 10.4.11 Mac Mail I get this: Mail cannot update your mailboxes because your home directory is full. You must free up space in your home folder before using Mail. Delete unnedded documents or move documents to another volume. I can't open mail.

    On 10.4.11 iMac Mac Mail I get this message: "Mail cannot update your mailboxes because your home directory is full. You must free up space in your home folder before using Mail. Delete unneeded documents or move documents to another volume." I can't open mail to do this. I have reinstalled software but no effect. How do I get into Mail to delete?

    Found this on the "more like this" Worked like a charm!
    With the Mail.app quit and using the Finder, go to Home > Library > Mail. Copy the Mail folder and place the copy on the Desktop for backup purposes.
    Go to Home > Library > Mail > Envelope Index. Move the Envelope Index file to the Desktop.
    Launch Mail and you will be prompted to import mailboxes. Select OK and allow the import process to complete.
    After confirming all mailboxes were successfully imported and available, you can delete the copy of the Mail folder and old Envelope Index file from the Desktop and this should resolve the problem.

  • Creating a directory on a remote machine using a UNC path

    Hi all,
    Is it possible to create a directory on a remote machine using a UNC path such as \\Server\Share\Directory?
    If so, how would i go about this? (Sorry for the newbie question, that's exactly what I am!)
    Thanks,
    Rob

    The tables on your pages are images. Not very convenient if the visitor wants to copy the information and use it.
    Read this how to use tables :
    http://www.wyodor.net/blog/archives/2010/01/entry_297.html
    http://www.wyodor.net/blog/archives/2010/01/entry_298.html
    Samples :
    http://www.wyodor.net/mfi/Maaskant/Seabreeze.html
    http://www.wyodor.net/mfi/Maaskant/Experiment.html
    http://www.wyodor.net/mfi/roodhout/Prices.html
    And here's a non-iWeb page with a sortable table :
    http://www.wyodor.net/htmlegg/TallCard/TallAjax.html?pg=tablesorter
    Or use a database on the server with MySQL and make tables with PHP :
    http://www.google.com/search?q=create+html+table+with+data+from+mysql+database
    Here's a very simple way to do it :
    http://home.wyodor.net/w3school

  • How can I create a directory on my server using FTP in applescript?

    Hi
    I have created a script which successfully uploads files to my server using FTP and a curl command.
    The one thing I haven't worked out how to do is how to create a directory on my server using applescript. At the moment I have to manually create the correct directory for the script to work, but would like to be able to automate everything.
    Would this be possible?
    Thanks
    Nick

    Thanks Bernard.
    I have tried that and still get the error message:
    "curl: Can't open '--ftp-create-dirs'!
    curl: try 'curl --help' or 'curl --manual' for more information
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
    curl: (9) Server denied you to change to the given directory"
    The other relevant parts of the script are:
    set ftp_url to "ftp.****.org.uk/artists/" & artistName2 & "/assets/"
    set ftp_username to "*****@*****.org.uk"
    set ftp_password to "****"
    set ftp_entire to ftp_username & ":" & ftp_password & " ftp://" & ftp_url
    set outPath to outputFolder & fileCounter & ".jpg"
    and then...
    do shell script ("curl -T --ftp-create-dirs " & outPath & " -u " & ftp_entire)
    Like I said, all works fine when the directories are already in place. I have permissions for the artists folder set to "777", i.e. writable. Because the script is trying to create two directories at once, i.e. "artistName2" and then "assets" under it, I wondered if this was significant, but then I tried with just one new directory, and still got the error.

  • How to create a directory or Folder  using java program?

    Hi all,
    Can any one know, how to create a directory(new folder) in java.
    can any give me some idea, on creating a directory using java program dynamically.
    thanx in advance

    hi thanks for your answer,
    sorry, actual i know this technique(its my fault i didnt mentioned it)
    i am looking for some what different technique.
    bye
    ram

  • Error- DBMS_STANDARD package must be created before using PL/SQL

    HI
    I am trying to run a very small and simple program on my Oracle81 personal edition on Win98.
    I get this error when i want to execute the program
    " package DBMS_STANDARD must be created before using PL/SQL "
    What should i do to create the package??
    Thank you
    Lin

    The Member Feedback forum is for suggestions and feedback for OTN Developer Services. This forum is not monitored by Oracle support or product teams and so Oracle product and technology related questions will not be answered. We recommend that you post this question to the Database - General forum or the Installation forum.
    The URLs are:
    General Database Discussions
    and
    Database Installation

  • Creating aVirtual directory Using java

    Hai ,
    I am Using windows XP Operating system, I know how to create a directory using java,
    can you please suggest me a procedure to create a virtual(web share ) directory using java.
    waiting for your reply
    Thanks & Regards,
    Naga Raju

    Virtual Programmer is in the to share the directory
    over the Internet.No, that's a file/web server. :) I see, it's a Microsoft term.

  • Creating a Directory using a MacBook Pro

    I am trying to create a directory with photos next to the contact information that can be saved as a pdf so that people can have it in iBooks on their phone.  What is the best program to do this?

    What kind of picture? Screen Shot? Command-Shift 3
    Using the Camera? Check out Photo Booth. It's in your applications folder.

  • Upload Entire Directory Using CFFILE

    I need to write an application that will allow the user to
    select all the contents of a directory on their local hard drive
    (or just point to the directory) and upload all the files in that
    directory to a location on a the web server. The user should not
    have to point to a file, just select all the contents at once.
    Does anyone know how to to so this using CFFILE? We are using
    ColdFusion 8.
    Thanks in Advance!!

    > If not, there must be a away--ColdFusion is such a great
    program, and I have
    > gotten it to do just about anything we need it to do
    except upload multiple
    > files files at once to our server...
    The files you are uploading are on the client computer.
    ColdFusion has
    *no* interaction with the client computer at all. All
    communications are
    between client and WEB SERVER. File uploads are handled by
    the client
    computer, using the provisions of the HTTP protocol, which -
    as implemented
    by a web browser - only allows for single files to be
    uploaded, via each
    file input control on a form.
    If you want multiple files to be uploaded from a client
    computer using a
    single control, you need to use something other than a web
    browser (as
    suggested by someone else: some manner of applet, perhaps
    embedded in an
    HTML document).
    The applet will pass the data to the web server, and if the
    request is for
    a mime type that the web server has been configured to pass
    to ColdFusion
    (usually a CFM or a CFC file), then the web server will pass
    the request to
    ColdFusion, which will deal with it however you tell it to.
    The problem isn't getting the files to CF; it's getting them
    to the web
    server in the first place. CF's got nothing to do with your
    problem (or,
    intrinsically, its solution).
    Adam

  • Create an entire web page using cffile

    I would like to create an entire web page using cffile..
    it seems that the output attribute is where you put the
    content like:
    output="this is a test."
    Q: so how do you add the full .htm content inside ....
    output=""
    ... where there will be lots of other double quotes?
    (if it involves 'escaping' characters - then I'll need some
    help with that.)
    Also : is it possible that the content could be some data
    combined with an cfinclude - i get errors when i try this...

    Well, I dont think I fully understand your intentions or
    goals are. However, from what I gather so far, you could output the
    data into pdf files. But like I said I dont understand what your
    trying to achieve. As far as the errors with <..etc, if they are
    included and you are trying to produce results those characters
    very well could cause problems when you are trying to do something
    that they were not intended to do.

  • How will i create physical directory in oracle pl/sql using java

    how will i create physical directory in oracle pl/sql using java

    This is, I suspect, related to Re: how will i overcome from this error java.io.IOException. Quite why you felt the need to have two partial threads instead of one thread with a complete set of information is beyond me. Perhaps this muddled thinking is indicative....
    Anyway, if I was looking to do this particular task in Java I would look to using the specific command File.mkdir() rather than trying to use a generic exec approach.
    Cheers, APC

  • Create Home Directory using VB Script

    Hello All,
    Did anybody is having VB script to create home directory.
    I can create a folder on the local machine through VB script but I am not able to create a folder on the network share|(like \\servername\Users\%username%).
    If anybody is having a sample code, please post it here.
    Thanks in advance

    nobody? :-(

  • Creating Target Directory Paths

    My questions are mixed in below, marked with "Q:"
    Task 7A-1-6 in the PTools 8.48 Installation Guide talks about directory path structures that are required by the Oracle DBMS install wizard, but need to be manually created by me.
    I installed database 10g. My SID is "HCM". There is an initHCM.ora file in my database folder. The contents were:
    SPFILE='C:\oracle\product\10.2.0\db_1/dbs/spfileHCM.ora'
    and I added the following, per install guide instructions:
    DB_NAME = HCM
    DB_FILES = 1021
    CONTROL_FILES = (/filesystem1/cntrl1HCM,/filesystem2/cntrl2HCM)
    OPEN_CURSORS = 255
    db_block_size = 8192
    remote_login_passwordfile=NONE
    Q: I substituted HCM for &lt;SID&gt; in the CONTROL_FILES variable, but are things like filesystem1 and filesystem2 meant to be literals, or is it intended that I substitute something for these? Also, there are some forward slashes in the SPFILE variable - is that ok for Windows?
    The guide mentions these CREATEDB.SQL references...
    startup nomount pfile=%ORACLE_HOME%\database\init&lt;SID&gt;.ora
    DATAFILE '&lt;drive&gt;:\oradata\&lt;SID&gt;\system01.dbf' SIZE 400M
    LOGFILE '&lt;drive&gt;:\oradata\&lt;SID&gt;\log01.dbf' SIZE 70M,
    '&lt;drive&gt;:\oradata\&lt;SID&gt;\log02.dbf' SIZE 70M;
    *...So I assume that I need to create c:\oradata\HCM*
    The guide then says:
    The init&lt;SID&gt;.ora parameter file that is referenced in the CREATEDB.SQL script makes the following
    directory path structure references:
    Note. Portions of the init&lt;SID&gt;.ora parameter file have been omitted for clarity. These paths are hardcoded
    by the user creating the init&lt;SID&gt;.ora parameter file. The Data Configuration Wizard will not make any
    substitutions for mount point, target directory path, or &lt;SID&gt; in the init&lt;SID&gt;.ora file.
    +
    Control file references:
    +
    control_files = ("c:\apps\db\oracle9i\oradata\ORC1\control01.ctl", "c:\apps\db&rArr;
    \oracle9i\oradata\ORC1\control02.ctl", "c:\apps\db\oracle9i\oradata\ORC1&rArr;
    \control03.ctl")
    background_dump_dest = c:\apps\db\Oracle9i\admin\ORC1\bdump
    core_dump_dest = c:\apps\db\Oracle9i\admin\ORC1\cdump
    user_dump_dest = c:\apps\db\Oracle9i\admin\ORC1\udump
    Q:  Does this mean I need to create c:\apps\db\Oracle10g\admin\ORC1 plus subfolders bdump, cdump and udump?  I particularly wonder if those exact names are correct, especially since the examples are for the 9i version.
    Q:  The guide says (above) that it's the init&lt;SID&gt;.ora parameter file which makes the above control file references... but as I showed above, that file only contained the one line, before I added the parms I mentioned.  Is the install guide saying that I should add the control file references above to my initHCM.ora file?

    With regard to the CONTROL_FILES variable...
    I'm not sure how forward slashes are meant to be interpreted in the Windows world. Are you saying that I should substititute an entire valid Widows path, like this?
    CONTROL_FILES = (c:\myfilesys1\cntrl1HCM.txt,c:\myfilesys2\cntrl2HCM.txt)
    ...after having first created folders c:\myfilesys1 and c:\myfilesys2, and that the database creation script will generate files cntrl1HCM.txt (I added the extension) and cntrl2HCM.txt?
    Can you post a sample Windows init<SID>.ora file?
    Edited by: M_Borok on Oct 7, 2008 7:46 AM
    (continued)
    ...on re-reading, it seems to me that section Task 7A-1-5: Creating an INIT<SID>.ORA File shows the general format:
    CONTROL_FILES = (/filesystem1/cntrl1<SID>,/filesystem2/cntrl2<SID>)
    ...but section Task 7A-1-6: Creating Target Directory Paths shows an example of substituted code for this line:
    control_files = ("c:\apps\db\oracle9i\oradata\ORC1control01.ctl", "c:\apps\db\oracle9i\oradata\ORC1control02.ctl", "c:\apps\db\oracle9i\oradata\ORC1\control03.ctl")
    Is that true? i.e. does this mean that I can create any path and file name I want, and the database create script will read it here and use it?
    If so, does this mean that I have to substitute actual paths ANYWHERE I see a forward slash?
    Also... I'm thinking that ORC1 in the sample code is their example of the SID, and for me it might be HCM instead.
    I note that their example shows three control files instead of the two shown in the first template. Does it matter.
    Q: Are these control files files that will be written by the create script, or are they a reference to files I should have created and populated?
    Edited by: M_Borok on Oct 7, 2008 7:51 AM
    Edited by: M_Borok on Oct 7, 2008 8:02 AM

  • Create dynamic directory name from form field on Sharepoint

    Trying to save pdf file to sharepoint site using URL; but need to create directory (initially) and filename dynamically. After directory created addtn'l files may populate dir, so need to check for directory exists; if so just copy files to dir based on field name. I'm able to save files to hard-coded location only, based on below.
    How to check and/or create dynamic directory base don field name?
    // folder level JavaScript to allow access to the identity object properties
    trustedIdentity = app.trustedFunction( function (sProperty)
    var iProperty = "";
    app.beginPriv();
    iProperty = identity[sProperty];
    app.endPriv();
    return iProperty;
    // folder level JavaScript to allow Save As population of file name
    mySaveAs = app.trustPropagatorFunction(function(myForm, path)
         app.beginPriv();
         var myForm = event.target;
         return rtn = myForm.saveAs(path);
         app.endPriv();
    myTrustFunct = app.trustedFunction(function(myForm, path)
         app.beginPriv();
         var vTest1 = event.target.xfa.resolveNode("topmostSubform[0].Page1[0].Test1[0]").rawValue.toString();
         var vTest2 = event.target.xfa.resolveNode("topmostSubform[0].Page1[0].Test2[0]").rawValue.toString();
         var vTest3 = event.target.xfa.resolveNode("topmostSubform[0].Page1[0].Test3[0]").rawValue.toString();
         var vTest4 = event.target.xfa.resolveNode("topmostSubform[0].Page1[0].Test4[0]").rawValue.toString();         
         var vpdf_url=location.href;location.href='http://mysite2010.com/documents
         var vPath = "/vpdf_url/" + vTest1 + Test2  + vTest3 + " .pdf";
              //console.println("vPath: " + vPath);
         var retn = mySaveAs(myForm, vPath);
         app.endPriv();
         return retn;

    Acrobat/Reader cannot create a directory. The directory needs to exist before Acrobat/Reader can save a PDF file to that directory.
    You could create a plug-in and use that plug-in to create the directory. The plug-in should also be able to determine if the directory exists or not.
    SharePoint can be tricky because it is not like most web sites. There is a special dash board that helps manage the different parts of SharePoint like list, folders, web parts, documents, etc so you may need to be aware of these features and adjust for them.
    For  folder level functions, I would not use any LiveCycle JavaScript variations. The folder level scripts are shared and accessible by Acrobat forms.

Maybe you are looking for

  • Motion tracking effect mask not working

    I've no trouble with normal motion tracking, adding clip art to it and having the clip art track, etc. But according to the help in PE8, effects masks are also supposed to be able to be used. According to help: You can also apply Effects Mask in the

  • Subversion: Cannot import files into a local repository

    If following the directions from here: http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/subversion/subversion.html I've got the local repository created and can successfully connect to it, but when it try to import files

  • Asset under costruction

    hi, can any body pls send me configuration steps for asset under costruction in detail.pls i am i need of it. points will be awarded swathi

  • Why do all of my icons on my desktop get replaced with itunes icons?

    Seriously, this is annoying. every time i install itunes, every single program/shortcut on my desktop and start menu is replaced with an itunes icon. please help me?

  • Bapi and lsmw.

    Hi all, I have some problems in understanding SAP integration with legacy systems and am into subscribing to canonical documents published by other leagcies. I just wanted to know which SAP adapter is the best taking in mind their complexity and fuct