Cfile - uploading 2 files on the same page

Hi,
Can anyone tell how to do this?
I have 2 file upload fields on the same page
<input name="FileContentsdec" type="file">
<input name="FileContents" type="file">
When I submit the page i use this code:
<CFif isdefined("form.filecontents") and
len(form.filecontents) gt 0>
<cfoutput>
<cftry>
<CFfile action="upload" filefield="FileContents"
destination="D:\inetpub\wwwroot\jobapp\files"
nameConflict="MakeUnique"
accept="application/msword,application/pdf" >
<CFset ClientFile = cffile.ServerFile>
<cfcatch>
<cflocation
url="?linkid=jobapp&page=apply&jobid=#jobid#&Message=#URLEncodedFormat('File
not uploaded - please select either a Word document or a PDF
file')#">
</cfcatch>
</cftry>
</cfoutput>
</CFif>
<!--- delcartion upload --->
<CFif isdefined("form.FileContentsdec") and
len(form.FileContentsdec) gt 0>
<cfoutput>
<cftry>
<CFfile action="upload" filefield="FileContentsdec"
destination="D:\inetpub\wwwroot\jobapp\files"
nameConflict="MakeUnique"
accept="application/msword,application/pdf" >
<CFset FileContentsdec = cffile.ServerFile>
<cfcatch>
<cflocation
url="?linkid=jobapp&page=apply&jobid=#jobid#&Message=#URLEncodedFormat('Declaration
info not uploaded - please select either a Word document or a PDF
file')#">
</cfcatch>
</cftry>
</cfoutput>
</CFif>
I then insert the filemanes into a db using:
<cfquery name="insert" datasource="#DataSource#" >
INSERT INTO applications (aloginid, ajobref
<cfif isdefined("ClientFile")>
,aotherinfo
</cfif>, aOffender <cfif
isdefined("filecontentsdec")>
,aOffenderinfo
</cfif>
) VALUES (#listrest(GetAuthUser())#, #jobid#
<cfif isdefined("ClientFile")>
, '#ClientFile#'
</cfif>, #offender# <cfif
isdefined("filecontentsdec")>
, '#filecontentsdec#'
</cfif>
</cfquery>
The problem is, the same filenames are inserted into boith
fields.
Can anyone help?
Thankyou

i dont think there should be any specific reasons for this.
coz it has worked out for me for upload of 4 files in a
single page
but still try the following:
1. set the filename variables to null before assigning the
serverfile name to it.
2. try not to use the reserved words as variable
names,Clientfile is a reserved word.

Similar Messages

  • How to create links to different files on the same page?

    Good day to all again,
    can someone please guide me through creating several links to different files on the same page. In other words, I am creating a photo page where my links are called Gallery 1, Gallery 2, etc... I would like to create links so when the User clicks on Gallery 1, they see Gallery 1 slide show in the frame; when the user then clicks Gallery 2, then they see Gallery 2 slide show in the window.
    My slide show files are done and I am using GoLive CS2. I have no knowledge of JavaScript or ActionScript/Flash.
    Any suggestions are highly appreciated.
    Thank you
    Alek

    Hi Diana,
    I'm a professional photographer and in the process of getting
    my finished site published. I used Coffeecup Photo Gallery. You can
    create multiple albums on the same page. Do a Google search for the
    address. It's easy, inexpensive, and it works. I tried to do this
    with the Photo Gallery in DW and FireWorks--but couldn't get it
    right. CC uses Flash and Javascript.
    Good Luck

  • How appears a  new JSP  file  in the same page?

    Hello all,
    I have a JSP file in a portal page.From this file I want to open another one.The new file must be opened in the same portal page with the same size and exactly in the same place. But it always openes a completely new page and the portal page disappears.I know that the mistake is from the provider file, but I don't know what should I change.
    Thanks for your help!
    K.Chrostani

    In my.jsp you could put a form with n submit buttons whith different values of parameter "name", like this:
    ---My.jsp------
    <form method="yourMethod" action="My.jsp">
    <input type="submit" value="Button1" name="button1">
    <input type="submit" value="Button1" name="button2">
    <input type="submit" value="Buttonn" name="buttonn">
    </form>
    <%if(request.getParameter("button1")!=null){%>
    <jsp:include page="f1.jsp">
    <%}%>
    <%if(request.getParameter("button2")!=null){%>
    <jsp:include page="f2.jsp">
    <%}%>
    <%if(request.getParameter("buttonn")!=null){%>
    <jsp:include page="fn.jsp">
    <%}%>
    I didn't try it but it might work.

  • Include a jsp file in the same page by click on a button

    Hello Everybody
    I'd like to control "my.jsp" page by clicking on some buttons. So if I click on Button1, f1.jsp go to be includeing in "my.jsp" or Button2 to include f2.jsp on "my.jsp" and so on
    Thank you in addvance

    In my.jsp you could put a form with n submit buttons whith different values of parameter "name", like this:
    ---My.jsp------
    <form method="yourMethod" action="My.jsp">
    <input type="submit" value="Button1" name="button1">
    <input type="submit" value="Button1" name="button2">
    <input type="submit" value="Buttonn" name="buttonn">
    </form>
    <%if(request.getParameter("button1")!=null){%>
    <jsp:include page="f1.jsp">
    <%}%>
    <%if(request.getParameter("button2")!=null){%>
    <jsp:include page="f2.jsp">
    <%}%>
    <%if(request.getParameter("buttonn")!=null){%>
    <jsp:include page="fn.jsp">
    <%}%>
    I didn't try it but it might work.

  • Audio and Video on the same page.

    Is it ok to have a separate audio and video file on the same page?  Both are set to auto play with no controls but when I try this set up the audio seams to override the video, stopping the video a few seconds later.
    I guess I could try and embed the audio into the video but if I did not have to I was not going to.
    Any suggestions or help is appreciated.
    Thanks,
    Ryan.

    You can't play both the audio and the video simultaneously, you'll need to merge them.
    Neil

  • Is it possible to upload multiple files at the same time?

    Hi folks,
    It seems pretty trivial to implement a file upload item, but is there some way to allow selection (upload) of multiple files at the same time? Seems like this has probably come up before, but I didn't find much for solutions in my search. Any links or insight would be appreciated.
    Thanks!
    -Adam vonNieda

    Thank you both for your replies.
    @Manish - That does allow for multiple file uploads without refreshing the page, but does not allow for multiple file uploads at the same time.
    @Tony - That might be the way I end up going, although I probably should have been more specific. It would be really nice it there was a way to do a mutli-file select using the control or shift button like you can with a standard file selection dialog (if you want to copy multiple files, for example). Having a separate line for each file browser means there has to be a limit on the number that can be selected at the same time.
    Has anyone implemented a method of selecting multiple files at once, and hitting an upload button once to get them into the database?
    Thanks again Manish and Tony, very helpful.
    -Adam

  • Upload more than one files at the same time

    Hi people!
    I'm having serious problems with struts. I have a list of contacts in which I can upload a file per person. The problem is that I have an unique form and I want to upload all the html:file at the same time. Is there any way of doing that? The problem is that I can't retrieve the values in the actionForm as FormFile[ ] as the other fields.
    I need help urgently!!

    I'm not sure uploading several files at once is possible. I have yet to see anything like that.

  • I have many photos with file extension of .PDD and that Photo Deluxe 4 no longer will operate in Win 7. How can I open?  Next in Elements 11, how do I load and print different pictures and different sizes options on the same page?

    I have many photos with file extension of .PDD and that Photo Deluxe 4 no longer will operate in Win 7. How can I open?  Next in Elements 11, how do I load and print different pictures and different sizes options on the same page?
    Thanks,
    Shir

    sbmgrams wrote:
    I have many photos with file extension of .PDD and that Photo Deluxe 4 no longer will operate in Win 7. How can I open?
    See here:
    Reading PhotoDeluxe PDD Files

  • How to upload multiple .CSV files in the same time.

    Hi Legends,
    Can anyone please help me to resolve my issue?
    This is very urgent and critical.
    Description:
    We have two users.1)edw_user_dump
    2)prd_udm.
    We need to upload the xx.csv file at the same time for these two users in oracle forms.
    we have differentiated .csv file name based on the user names.
    the main problem is in the sql loader command the xx.csv file name is created but the data is not captured in the server (kentucky) .
    Below is my code for the upload.
    -- To delete the Part_Mast.log file from the client
    DECLARE
    pid WEBUTIL_HOST.PROCESS_ID;
    v_result PLS_INTEGER;
    v_username varchar2(30) := GET_APPLICATION_PROPERTY(USERNAME);
    BEGIN
    v_result := WEBUTIL_HOST.Get_return_Code(pid ) ;
    host('cat /dev/null > /tmp/'||v_username||'_'||'EDW_CF_IO_UPLOAD.log');
    host('cat /dev/null > /tmp/'||v_username||'_'||'"CF615 IO Upload.csv"');
    END;
    DECLARE
    l_success boolean:=FALSE;
    l_bare_filename varchar2(100):=NULL;
    v_username varchar2(30) := GET_APPLICATION_PROPERTY(USERNAME);
    BEGIN
    -- Delete the content of the log and bad file
    host('cat /dev/null > /tmp/'||v_username||'_'||'EDW_CF_IO_UPLOAD.log');
    --host('cat /dev/null > /tmp/Part_Mast.bad');
    -- Upload the data file to Application Server
    l_bare_filename := v_username||'_'||substr(:FIC_SOURCE,instr(:FIC_SOURCE,'\',-1)+1);
    l_success := webutil_file_transfer.Client_To_AS_with_progress
    (clientFile => :FIC_SOURCE
    ,serverFile => '/tmp/'||l_bare_filename
    ,progressTitle => 'Upload to Application Server in progress'
    ,progressSubTitle => 'Please wait'
    ,asynchronous => false
    ,callbackTrigger => null
    IF l_success THEN
    NULL;
    ELSE
    null;
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
    RAISE Form_Trigger_Failure;
    END;
    DECLARE
    v_username varchar2(30) := GET_APPLICATION_PROPERTY(USERNAME);
    begin
    host('cat /dev/null > /tmp/'||v_username||'_'||'EDW_CF_IO_UPLOAD.log');
    host('cat /dev/null > /tmp/EDW_CF_IO_UPLOAD.bad');
    end;
    BEGIN
    DECLARE
    v_username varchar2(30) := GET_APPLICATION_PROPERTY(USERNAME);
    v_password varchar2(30) := GET_APPLICATION_PROPERTY(PASSWORD);
    v_connect_string varchar2(30) := GET_APPLICATION_PROPERTY(CONNECT_STRING);
    a_host varchar2(500);
    BEGIN
    a_host :='/tmp/'||v_username||'_'||'"CF615 IO Upload.csv"';
    host('sqlldr '||v_username||'/'||v_password||'@'||v_connect_string||' '|| 'control=/home/edw_bis/ctl/GLB_CF_IO_UPLOAD.CTL'||' '|| 'DATA=a_host'||' '|| 'LOG=/tmp/'||v_username||'_'||'EDW_CF_IO_UPLOAD.log SKIP=1 errors=200000 DIRECT=FALSE');
    dbms_output.put_line(a_host);
    END;
    DECLARE
    v_username varchar2(30) := GET_APPLICATION_PROPERTY(USERNAME);
    begin
    host('cat /dev/null > /tmp/'||v_username||'_'||'"CF615 IO Upload.csv"');
    EXCEPTION
    WHEN OTHERS THEN
    RAISE Form_Trigger_Failure;
    END;
    end;
    DECLARE
    al_id3 ALERT;
    al_button Number;
    BEGIN
    edw_user_dump.SANM_PRC_MERGE_CF_IO_UPLOAD(:global.v_plsql_res,:global.v_ins_rec,:global.v_upd_rec);
    IF NVL(:global.v_plsql_res,0) = 0 and (:global.v_ins_rec !=0 OR :global.v_upd_rec != 0 ) then
    al_id3 :=FIND_ALERT('ROWINS');
    SET_ALERT_PROPERTY(al_id3,alert_message_text,' Process Completed Successfully!'||CHR(10)||' Rows Inserted : '||:global.v_ins_rec ||CHR(10)||' Rows Updated : '||:global.v_upd_rec);
    al_button := SHOW_ALERT( al_id3 );
    ELSIF (:global.v_plsql_res IN(-1,0) or :global.v_plsql_res > 0) and (:global.v_ins_rec =0 and :global.v_upd_rec = 0 and :global.v_del_rec =0 ) then
    al_id3 :=FIND_ALERT('ROWINS');
    SET_ALERT_PROPERTY(al_id3,alert_message_text,' Process Failed. Please Download the Log File '||CHR(10)||' Rows Failed : '||:global.v_plsql_res||CHR(10)||' Rows Inserted : '||:global.v_ins_rec ||CHR(10)||' Rows Updated : '||:global.v_upd_rec);
    al_button := SHOW_ALERT( al_id3 );
    ELSE
    al_id3 :=FIND_ALERT('ROWINS');
    SET_ALERT_PROPERTY(al_id3,alert_message_text,'Please Download the Log File '||CHR(10)||' Rows Failed : '||:global.v_plsql_res||CHR(10)||' Rows Inserted : '||:global.v_ins_rec ||CHR(10)||' Rows Updated : '||:global.v_upd_rec );
    al_button := SHOW_ALERT( al_id3 );
    END IF;
    EXCEPTION WHEN OTHERS THEN
    RAISE Form_Trigger_Failure;
    END;
    DECLARE
    v_username varchar2(30) := GET_APPLICATION_PROPERTY(USERNAME);
    begin
    host('cat /dev/null > /tmp/'||v_username||'_'||'"CF615 IO Upload.csv"');
    host('rm -rf /tmp/'||v_username||'_'||'"CF615 IO Upload.csv"');
    end;
    Thanks in advance!
    Thanks,
    Madhusudhanan

    Madhusudhanan,
    A couple of observations. First; always list your exact Forms version (eg; 10.1.2.0.2 not 10g R2). In most cases, the solution is different depending on the Forms version. Second; why must you use Forms to kick off a SQL Loader process? This is a server-side process and should be initiated by a server side process. If you absolutely must use Forms to kick off the process, again we need your Forms version in order to offer any solutions. Based on your code sample, I can asusme you are at least using Forms 9i becuase you are using WebUtil.
    Is your Database and Application Server the same physical computer? If they are not, this would explain why your HOST command isn't working because HOST runs against the Application Server not the Database server.
    Third; have you considered using and External Table (if your RDBMS version supports them) for each of the files you are attempting to upload? In this instance, it would be helpful to know your RDBMS version as well. External Tables can be a little frustrating to set up the first time, but as with any new construct you use - it gets easier the more you use it.
    Fourth; are you getting any errors in your log file(s)? If so, what are the errors? Please list the full error message if you have one.
    Finally, with respects to your statement:
    Posted: Mar 18, 2011 2:30 PM - Madhu This is very urgent and critical.>
    You have to understand that forum contributers are all volunteers - this is not our full-time job. If your issue is truely urgent I suggest you open a Service Request (SR) with Oracle Support! ;-)
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Firefox does not recognize hyperlinks denoting files and pages in regarding the html written to direct to the file in the same web directory. Ie: a href=myarticle.pdf

    The hyperlinks are recognized by other browsers, except Firefox. A simple fix would be for any webmaster to make sure the full hyperlink is written, but that would be inclusion just for Firefox users. Simply put, Firefox should still be able to work like a DOS batch file linking files on the same directory viewed in this manner, but fails to.

    That is an MS Office document and everything on that page is a image as you can see in Tools > Page Info > Media and Firefox/Tools > Web Developer > Page Source
    If you used MS software then make sure that you disable VML if you save that page because only IE can display pages with VML
    You can look at KompoZer for an HTML editor that generates W3C compliant code.
    * http://kompozer.net/

  • I wish an Ipad. Is it possible to work on the screen with 2 application toghether (2 Pages file in the same screen view) ?

    I wish an Ipad. Is it possible to work on the screen with 2 files toghether (ex: 2 Pages files in the same screen view) ?
    I need to make some transalations and so it's important for me to have the english text and the italian version that I am making, on the same screen view.
    Thank You.

    No. You cannot work on two Pages files in the same window. It is not possible to have multiple windows on the screen at the same time in iOS.

  • I use "element 12" and want  like in the old PS version due Automating and Contact  II upload multiple filesand print them with any columns and rows on the same page . How does it work?

    I use "element 12" and want  like in the old PS version due Automating and Contact  II upload multiple filesand print them with any columns and rows on the same page . How does it work?

    Can you supply a link?

  • When "Upload File" , show the IE error page

    question: when "Upload File" , show the IE error page. How to soluve the problem?

    Duplicate post.
    when "Upload File" , show the IE error page
    when "Upload File" , show the IE error page

  • How can I get one audio file to stop once another is triggered on the same page in EPUB?

    I have multiple audio files on one page and am able to trigger each separately with their own control panels. Unfortunately, these can all be played over one another. Is there a solution within InDesign to stop the first active audio file once another audio button is triggered on the same page?
    WIll this have to be done through Javascript?

    Use buttons. They can have have more than one action. Set a button to stop the first audio, and start the second.

  • Controlling sound of separate html files within the same html page.

    I need to allow users to preview audio files for purchasing. I have CF pages that return records form a SQL database. Each record contains the same swf file however, each swf file points to a different mp3 for previews of different audio examples. So far, everything is working fine. My problem is that I need to be able to stop the sound from one  swf when I click to play a second swf.  The only solutions I see in Flash forums deal with loaded swf files. These are not loaded files they are separate files within a page. The question is: How do control one swf from another swf in the same page.  The following items have not worked:
    soundChannel.stop();,
    soundMixer.stopAll()
    I think my solution may be to use ExternalInterface but I am not sure where to begin with this. Any suggestion would be appreciated.

    you need to use the localconnection class to communicate between swfs open at the same time by the same client.

Maybe you are looking for

  • Point of view on running Mountain Lion on a late 2011 Mac Book Pro?

    I bought my MacBook Pro a couple of days before the current genneration came out in June of 2012.  I was told that Mountain Lion would run well even on the older genneration and I was convinced by the 'genius' that it would be well worth it to buy th

  • How to add events to Safari context menu

    Hi there, I have yet to buy an iPad, the choice is currently between the iPad and the Kindle. Although I would in fact prefer a general-purpose computer such as the iPad, the Kindle does meet all my current needs. Additionally, the Kindle has a singl

  • XI content in AII

    Hi experts,                 Iam new to AII. How to make use of XI content in AII in order to communicate with XI.How can we configure this in XI. Reyaz Hussain

  • Concat UDF question

    Hi all, I  have a requremnt in the map. Source looks like this, Description (Node) 1-many  >   It has 2 fields in it namely : 1.  Indicator(String) 0-1 2. Comment(String) 1 Now target looks like this ProductDescription(Node) 1-many  > it has just 1 n

  • Color changing when Saving Photo -

    We sell coins on our website - So the color makes all the difference in the world to weather you want to buy the coin or not. We use a Nikon to take the pics - Pics come out great, the colors looks like actual coin when viewing in photoshop and in th