Upload file to a particular folder in UCM

I want to upload file to a particular folder location in UCM.
When I am uploading it is going to the default location though i programmatically have set the folder path
I am using Adf application in Jdev 11.1.1.3
As i am new to UCM i do not have idea of whether to define the location at ucm level or in our program
Below is my code like this
public void checkInContent(TransferFile file){
UploadContentVORowImpl row=(UploadContentVORowImpl)this.getUploadContentVO1().getCurrentRow();
IdcClient client= UCMRepositoryOperations.getIdcClient();
DataBinder binder= client.createBinder();
binder.putLocal ("IdcService", "CHECKIN_UNIVERSAL");
binder.addFile("primaryFile", file);
String fileType=file.getContentType().substring(0,file.getContentType().indexOf("/"));
int contentId= new SequenceImpl("UCM_CONTENT_ID_SEQUENCE",getDBTransaction()).getSequenceNumber().intValue();
binder.putLocal("dDocID", contentId+"");
binder.putLocal("dDocName", file.getFileName());
binder.putLocal("dDocTitle", file.getFileName());
binder.putLocal("dDocType","DigitalMedia");
SimpleDateFormat sdf=new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
binder.putLocal("dInDate",sdf.format(row.getFromDate().dateValue()));
binder.putLocal("dOutDate",sdf.format(row.getToDate().dateValue()));
binder.putLocal("xScope",row.getScope());
if(row.getStateId()!=null){
binder.putLocal("xState", row.getStateId().toString());
if(row.getDistrictId()!=null){
binder.putLocal("xDistrict",row.getDistrictId().toString());
binder.putLocal("dLocation", "/Contribution Folders/sahaj/content/loginPageNews");
binder.putLocal("dAuthor", "Test");
binder.putLocal("dSecurityGroup", "public");
binder.putLocal("blDateFormat", "dd-MM-yyyy HH:mm:ss");
ServiceResponse resp=null;
String response=null;
try {
resp = client.sendRequest(UCMRepositoryOperations.getContext(), binder);
} catch (IdcClientException e) {
ucmAMLogger.severe(e);
try {
response=resp.getResponseAsString();
resp.close();
} catch (IOException e) {
ucmAMLogger.severe(response);
ucmAMLogger.info(response);
}

The xContributionFolder should be an ID, not a file path.
To determine the correct ID, this PL/SQL function may be useful :
function f_get_folder_id ( p_folder_path in VARCHAR2)
return NUMBER
is
v_parent_folder_id NUMBER := 429910249369000002 ; -- ID of 'Contribution Folders/Root' collection
v_folder_name VARCHAR2(255);
v_folder_path VARCHAR2(32000);
pos_next_separator NUMBER;
CURSOR c_get_folder_id ( p_parent_folder_id in number, p_folder_name in varchar2 )
is
SELECT dcollectionid
FROM collections
WHERE dcollectionname = p_folder_name
AND dparentcollectionid = p_parent_folder_id;
begin
v_folder_path := p_folder_path ;
-- strip first '/'
if ( substr(v_folder_path,1,1) = C_FOLDER_SEPARATOR ) then v_folder_path := substr(v_folder_path,2); end if;
pos_next_separator := instr(v_folder_path,C_FOLDER_SEPARATOR) ;
while ( pos_next_separator > 0 )
loop
v_folder_name := substr(v_folder_path,1, pos_next_separator - 1);
v_folder_path := substr(v_folder_path,pos_next_separator+ 1);
open c_get_folder_id ( p_parent_folder_id => v_parent_folder_id , p_folder_name => v_folder_name );
fetch c_get_folder_id into v_parent_folder_id;
close c_get_folder_id ;
pos_next_separator := instr(v_folder_path,C_FOLDER_SEPARATOR) ;
end loop;
v_folder_name := v_folder_path;
open c_get_folder_id ( p_parent_folder_id => v_parent_folder_id , p_folder_name => v_folder_name );
fetch c_get_folder_id into v_parent_folder_id;
close c_get_folder_id ;
dbms_output.put_line('Found :' ||v_folder_name||' id '||v_parent_folder_id);
return v_parent_folder_id;
end f_get_folder_id;

Similar Messages

  • Saving a file in a particular folder over the tomcat server

    I have a java class in the background of a JSP which creates an XML file and saves it.
    Furthermore another class picks that file and processes it. While running this program on my local computer it is obviously working fine but in order to run it on a tomcat server or for that matter any server, I want it to save the XML file in a particular folder, for example:
    tomcat_home/webapps/myapplication/ xmlfolder / something. xml
    so that my other class can easily pick up the file and I dont need to change the location each time I change the server.

    You can get the context root(the place from wher the aplication is running) of your application and then save the file somwhere, but i >>woulden't recomend that. But this is what you are looking for.How ?
    You can also just save the file, it will be saved in a temp directory. (use this only if the file is a temp file not for storing purposes)Just saving the file somehow doesnt work for me as the folder where a class is saving a file by default is somehow different from the folder where another class is trying to pick a file by default. Even if I give no path
    Other option is just to configure a tomcat system variable that specifys an folder. You can get that property from your application and >>then save the files there.Im not able to consider this one because the application will be put on different servers by different people later so they would all then need to configure their systems just to read a file. I was sure there were better ways. :(

  • How to upload files residing in a folder on local file system .

    Hi, I have a problem when trying to upload files.
    I have a folder in my local system and have n files in it. Now if i use the file upload element i need to click n times to upload these files. So i want to achieve programatically to upload all the files in a folder given the folder name to the application. Is this possible or is there any restriction to achieve this through webdynpro.
    Also how to know programatically all the names of files and folders in a particular folder during web dynpro session.
    Regards,
    Vinay.

    Hi Vinayaka,
    Watch these links..
    Uploading multiple files using the FileUpload UI element
    Files...
    Regards,
    Karthick K Eswaran
    Display files in web browser

  • Uploading File to a particular location

    Hi,
    I need to upload a file to a particular location using the Struts framework.
    I have been reading about the html:file tag.
    But I did not come across any information as to where the file gets uploaded to. I need the file to be uploaded to a location in my project.
    How do I do it?
    Could anyone post a code sample for this?
    Thanks in advance.

    http://www.google.com/search?q=struts+file+upload
    I see lots of useful examples tho.
    Saving the retrieved file to a particular location has nothing to do with Struts. Just handle it in your Javabean. Check the java.io API.

  • Upload Files into SAP Office Folder in Background

    Hi All ,
    Has anyone tried uploading file(s) of any type say *.XLS , *.PDF to SAP office folder (Outbox) in the background . I am using the function module  'SO_DOCUMENT_REPOSITORY' with methods "SAVE" , "ATTCREATEFROMPC" and "SEND" . It works fine in foreground without any errors . But when tried to schedule in background , the job stops at the method call "ATTCREATEFROMPC" and gives a message  "Database error for <INSERT INTO KPRO> " . It looks like the uderlyiong function module checks for an active GUI and fails during background .
    Any thoughts or other solutions would be appreciated ....
    Thanks

    Hi,
    I think ATTCREATEFROMPC method is for loading the file from frontend PC. It is bound to fail if you run it in background since there is no SAPGUI running it and it can't know the location.
    You will need to use some other method to be able to read the files from the APP server, and have your documents on the APP server if you want to run your code in the background.
    cheers,
    Ajay

  • Upload file in to km folder using ETL tools

    Hi Experts,
    I have requirement, to upload html file in to km repository using some ETL tool. Is it possible? If not...
    How i can bring a file from a different server in to portal km repository?
    Regards
    Baby

    Hi all,
    I am closing this question... since i got a better way to proceed...
    In our portal we have a file system mountpoint (etc). We are able to FTP html files in to this folder through ETL scheduling... 
    I think this is better way, also have discussion with some of my friends... any comments..
    Regards
    Baby
    Edited by: Baby on May 25, 2009 4:11 PM

  • How to move xml files to a particular folder?

    I have made XML forms for new which is having approval feature.
    Now i want that  after the approver approves the news ,the respective xml file of the approved news should move to a particular folder defined by me in KM.
    Is it possible....?If yes, how?

    Hi
    Other way of achieving this is to create a repository service which listens to the publish event. You can write the code to move document in the received method of repository service. If any document is published, event will be triggered and the service will be invoked, the code to move the document will be executed.
    Check the link:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/30143cc1-d176-2a10-55a3-ea498211e424
    Regards,
    Yoga

  • Upload file to windows share folder running on unix

    Hi, I am having requirement to upload the files into windows share folder, It works fine If I run the application on windows, but we moved the application to UNIX, so right now the client has to upload the files to windows shareholder , server is running on the UNIX,
    as I am using the simple File file = new File(//share/shareholder),
    so the problem is once we move to UNIX, how can I handle ., any example will really helpful.
    Thanks
    Srikanth

    k, when I run the UNIX, I am getting below error, It works fine If I run in windows, but when I run in Unix getting error, as all are inside the network.
    jcifs.smb.SmbException: Failed to connect to server
    java.net.UnknownHostException: shareServer
    at jcifs.UniAddress.getByName(UniAddress.java:297)
    at jcifs.UniAddress.getByName(UniAddress.java:201)
    at jcifs.smb.SmbFile.getAddress(SmbFile.java:792)
    at jcifs.smb.SmbFile.connect(SmbFile.java:820)
    at jcifs.smb.SmbFile.connect0(SmbFile.java:797)
    at jcifs.smb.SmbFile.open0(SmbFile.java:852)
    at jcifs.smb.SmbFile.open(SmbFile.java:881)
    at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:139)
    at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:97)
    at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:67)
    at jcifs.util.FileTest.main(FileTest.java:37)
    at jcifs.smb.SmbFile.connect0(SmbFile.java:799)
    at jcifs.smb.SmbFile.open0(SmbFile.java:852)
    at jcifs.smb.SmbFile.open(SmbFile.java:881)
    at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:139)
    at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:97)
    at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:67)
    at jcifs.util.FileTest.main(FileTest.java:37)

  • How to read the name of .csv file from a particular folder using Oracle.

    Gurus,
    I have a folder called 'data_dir' in Oracle Server and it contains 10 different .csv files and the name of the each file is being suffixed by date and time(24 hrs format).
    First i need to read all the file names then i have to process those files by UTL_FILE to load the data into a relational table.
    Is there any mechanism is available in Oracle to read the file names?
    (In this case all the 10 different csv file names)
    If so, then please help me accomplish this.
    Thanks in advance.
    Regards,
    Venugopal.K

    Is there any mechanism is available in Oracle to read the file names?Sounds to me like you need to use External Tables (*not* utl_file).
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/et_concepts.htm

  • Upload files using JSP

    i am creating an application that allow user from client-side to upload their files to a particular folder in the server-side. But my application isnt functioning as the application cannot get the files into that folder.
    Is there any extra coding needed? Urgent help in this area...
    Thanks...

    Dear,
    I tried request.getInputStream() method to get content
    PrintWriter pw = new PrintWriter(
    new BufferedWriter(new FileWriter("c:\\Demo.out")));
    ServletInputStream in = request.getInputStream();
    int i = in.read();
    while (i != -1) {
    pw.print((char) i);
    i = in.read();
    pw.close();
    but u need to modify it..

  • Problem in uploading file through API

    I want to upload files in to mycontent folder through our
    application.After each steps followed, i get the status message ok
    from the server, but file is not uploaded. Is there any idea about
    this? Please help.

    what do you mean exactly with 'the file is not uploaded'?
    you checked in the content directory and the file isn't
    there?
    if so, could you please post your server side upload
    code?

  • MULTIPLE UPLOAD file problem

    Hello,
    I have a problem with multiple upload file tool.
    Because my server need, in order to upload files in its folders, to be logged only with ftp user (that is unique).
    Now, I need that when I upload a file its name will be stored on db table "file_name". But in order to put data in database i have tobe logged also with user that is allowed to access on mysql db.
    So I understand that I should nedd to types of authentication at the same time...
    I think it depends on my type of hosting that is windows, and there is not the possibility to change CHMOD, so the error when I try to upload a file is that the folder has not write permissions...
    Any suggestions?
    Thanks a lot
    ascaro231
    Italy

    Hi ascaro231,
    wow, that is one bag of problems on the remote side :-(
    to be logged only with ftp user
    although PHP itself provides native FTP functions
    (e.g. for uploading files and also changing folder & file permissions), ADDT´s file upload features don´t support this protocol
    and there is not the possibility to change CHMOD
    CHMOD *will* have to be supported by your host, because this is how ADDT changes folder & file permissions.
    Well, to me it seems that your host doesn´t provide some very basic and truly common-standard PHP settings -- and honestly, disabling the regular PHP file upload features is ridiculous.
    Any suggestions?
    go for a better host -- this is just inacceptable.
    Are you hosting with "Aruba" BTW ? They have both Windows and Linux hostings, and AFAIK it´s possible to switch the hosting type.
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • Placing the file in the Dynamic folder

    Dear All,
    We are having the some requirment like.
    We developed one Adaptermodule to pick up the Excel sheet and reads and create one file for each sheet. These files are placing in one Target folder.
    Here we are developing the one more communication channel to pickup the file from this folder and trying to place the file in the particular folder based on the File name.
    Now my requirement is we need to place the file in the Target folder based on the File Name.
    For ex if the File name is INT0001.txt then we need to place this file in usr\sap\450\in\INT0001\  folder and
    if the file name is HIRING.txt then we need to place the file in usr\sap\450\in\HIRING\
    if the file name is INT009.txt then we need to place the file in usr\sap\450\in\INT009\
    Here we are not using any IR objects in this development.
    Please give any suggistions to solve this problem.
    Regards
    Goli Sridhar

    Hi,
      Try Variable Substitution method.Refer the link for use of Variable Substitution..
    [http://help.sap.com/saphelp_nw70/helpdata/EN/bc/bb79d6061007419a081e58cbeaaf28/content.htm]
    In file access parameter you should select create target directory.
    you should have read,write access for creating folder.
    Regards,
    Prakasu

  • How to associate an uploaded file with form data

    I have a "ticketing" app which stores a ticket no. as well as allows users to upload multiple files per ticket. The problem I am having is how to associate an uploaded file with a particular ticket no. As you can guess this becomes complicated when the same user can potentially update multiple tickets using the same file names. I am having difficulty trying to understand how to associate a ticket no with one or more uploaded files. I do have a custom table which I update with the attachments but I am unsure how to, or when to, update the ticket information on this custom table. I only want to retrieve attachments for a given ticket, not all attachments uploaded by a user.Does anyone have any ideas?

    Hi,
    My question is bit related to this topic.
    I am having a requirement to upload the CSV files so that they will store in a database table and later on wards when they search on that table it needs to pull the information and display on the form. I am a new bee to application express. Could some body tell me how to start this process with??. Just give me an overvoew/hints so that I will try to carry on my own.
    Cheers,
    Krishna.

  • Can anybody provide the SQL query to find the files uploaded in a particular folder?

    Hi All,
    Can anybody provide the SQL query to find the documents (document name) uploaded in a particular folder? While clicking on folder in
    GUI I'm hitting the Timeout error. I would like to find the files uploaded into this folder from SQLPLUS.
    Any help is greatly appreciated.
    With best regards,
    Nevin

    Nevin,
    Be great if we could know the version of Portal. For Rel. 1, here's the query
    select id,masterthingid from wwv_things
    where siteid = &site
    and cornerid = &corner
    &site - Content Area id
    &corner - Folder id
    if you don't know the folder id, use
    select id from wwv_corners where siteid = &site
    and name = &folder
    Hope this helps. I have run into this situation before. Usually, the culprits were
    one of the following:
    1. Junk Characters in description of item (caused due to Copy-Paste)
    2. Special Characters in the File name
    Hi All,
    Can anybody provide the SQL query to find the documents (document name) uploaded in a particular folder? While clicking on folder in
    GUI I'm hitting the Timeout error. I would like to find the files uploaded into this folder from SQLPLUS.
    Any help is greatly appreciated.
    With best regards,
    Nevin

Maybe you are looking for

  • Why won't dropbox documents print via bluetooth to a pima ip100

    Why won't dropbox documents print via bluetooth to a pixma ip100 from a Mac Pro.  The ip100 prints gibberish continuously until it is unplugged.  There is no other way to stop the printing.

  • Transaction error AFAB.

    Hello!! Please, can someone help me!! Can someone tell me How can I run the transaction AFAB without one asset. I have one error message in one asset. But the amount is cero, because the asset is completly depreciated. Message no. KI235 Account XXXX

  • Open default mail application and attach the shortcut to it

    Hi All , I have one requirement in which we need to open default mail application from SAP then create a new memo in it and attach the shortcut of one transaction in that new memo. Can anybody please help me in the same ?

  • Need help finding Mavericks download

    So in the past couple days I updated my mac from 10.5 to 10.6.8. I want to update it to 10.9 but can't find the download anywhere. The app store only has Yosemite now and I can't find 10.9. I've found 10.9.3 and 10.9.5 but can't install those until I

  • Time always goes back to GMT

    I set my time zone to New York city, and either manually set the time or tell it to automatically set it off the Apple server, then lock the settings and still it switches back to GMT. So here it is 11:56 in NYC and my computer says 3:65. Is there a