Upload and download the file same name but different extension from the document library.

HI,
     I am using the Client Object Model (Copy. Asmx ) To upload and download the file from the document library.
I am having the mandatory File ID for the each Document.
I tried to upload the the document (KIF53.txt) with File ID (KIF53) uploaded successfully.
Again I tried to Upload the document(KIF53.docx) With File ID(KIF53) its uploaded the file but it not upload the File ID in the Column
Please find the below screen shoot for the reference.

thanks ashish
tried 
My requirement is to create the  folder and sub folder in SharePoint document library. If already exist leave it or create the new folder and the subfolder in the Document library using client side object model
I able to check for the parent folder.
But cant able to check the subfolder in the document library.
How to check for  the sub folder in the document library?
Here is the code for the folder IsFolder alredy Exist.
private string IsFolderExist(string InputFolderName)
        string retStatus
= false.ToString();
        try
            ClientContext context
= newClientContext(Convert.ToString(ConfigurationManager.AppSettings["DocumentLibraryLink"]));
context.Credentials = CredentialCache.DefaultCredentials;
            List list
= context.Web.Lists.GetByTitle(Convert.ToString(ConfigurationManager.AppSettings["DocumentLibraryName"]));
            FieldCollection fields
= list.Fields;
            CamlQuery camlQueryForItem
= new CamlQuery();
camlQueryForItem.ViewXml = string.Format(@"<View 
Scope='RecursiveAll'>
<Query>
                      <Where>
<Eq>
<FieldRef Name='FileDirRef'/>
<Value Type='Text'>{0}</Value>
                        </Eq>
</Where>
</Query>
</View>", @"/sites/test/hcl/"
+ InputFolderName);
Microsoft.SharePoint.Client.ListItemCollection listItems
= list.GetItems(camlQueryForItem);
context.Load(listItems);
context.ExecuteQuery();
            if (listItems.Count
> 0)
retStatus = true.ToString();
            else
retStatus = false.ToString();
        catch (Exception ex)
retStatus = "X02";
        return retStatus;
thanks
Sundhar 

Similar Messages

  • Importing files with same name but different extensions

    Hope I will be clear enough.
    Lets say that instead of sending a file from Lightroom to an external editor, I open it directly in Photoshop.
    When I'm done, I save the edited photo using the same name but in a different file format : IMG_1333.cr2 > IMG_1333.psd or IMG_1333.tif, and selecting the same folder location.
    Then, I come back into Lightroom and synchronise the folder.
    Why is the knew version of the picture not showing up beside the original file, despite the different extension ?
    I notice that the different extensions ( .psd or .tif ) are recorded in the sidecar files field in the Metadata panel.
    Of course, everything works fine if the file name is modified ( or just by selecting the "copy" option in Photoshop's "save as" dialog box ). Lightroom synchronise dialog shows the new photo to import.
    So, why is Lightroom not making a difference between files with the same name but different format extensions ?
    Thanks for any hint :-)
    Gilles.

    Gilles-
    I think your problem is likely that you have the option to stack the copy with the original turned on. First, right-click on one of these photos and go to the stacking menu. If Unstack is not grayed out then you have a stack -- select Unstack to reveal all copies.
    To change the automatic stacking of edited copies from Photoshop, when you next choose to edit a file, in the bottom left corner of the dialog is the check box for unstacking. Clear it, and that choice should "stick" until you change it again.
    Hope this helps!
    Tony

  • Change selected file to a file with same name but different extension.

    So I'm getting better at using Automator to create useful Services but still a bit of a newbie with doing powerful things with AppleScript... and I think this task requires some applescripting. Here's what I want to do:
    1. Based on a selected text file I want to run a pre-existing script that converts this file into an HTML file. This new file has the same name as the text file but has the .html extension rather than the .txt extension. (This step is easy enough and it works just fine already.)
    2. BUT NOW, I want to take that resulting HTML file and run another pre-existing script that converts the HTML file into an RTF file. The problem is that I basically want to change the selection from selectedfile.TXT to selectedfile.HTML so that I can proceed to this next step...
    3. AND THEN, I want to launch an app with this resulting RTF file. Again, I need to change the selection to selectedfile.RTF.
    Right now this requires me to run three different services, and changing the selected file between each step... But I'm sure there's an easy applescript way (or other way) to do this using just one service -- probably involves some filename parsing and some magic to change the selection??? -- or something like that...
    Could anyone point me in the right direction???
    Thank you thank you thank you!
    ~zyyyy

    You can chain your scripts together - depending on the complexity of your pre-existing scripts, you could do this with either AppleScript or Automator. The workflow would just take the selected text file (from step 1), convert to both HTML (2) and RTF (3), then launch your application with the resulting RTF - no need to change any selection.
    By the way, this is the Tiger Automator forum - Snow Leopard's Automator is quite a bit different, so you will probably have better luck posting in the Snow Leopard forum.

  • Applescript: Create a Folder from Files of Same Name but different Extension

    Hi guys,
    Racking my brain for the past 2 hours trying to figure out how to properly use Applescript but alas to no avail.
    My  problem is as follows.
    xxxxxxx.extension1
    xxxxxxx.extension2
    yyyyyyy.extension1
    yyyyyyy.extension2
    zzzzzzz.extension1
    zzzzzzz.extension2
    I've been trying to create an applescript that takes files of same name and create a folder with the name of those files grabbed.
    So ultimately it would look like
    xxxxxxx/
         xxxxxxx.extension1
         xxxxxxx.extension2
    yyyyyyy/
         yyyyyyy.extension1
         yyyyyyy.extension2
    zzzzzzz/
         zzzzzzz.extension1
         zzzzzzz.extension2
    Can some more more adept at this than me provide with a solution?  It would be great if I could use by just selecting the folder that contains all these files.
    Also can anyone suggest an beginner's book on Applescript?  I'm a bit or an order freak and Im sure applescripting could help me automate a lot of repetitive tasks Im currently doing.
    Thanks!

    This will do what you need.
    set source to (((path to desktop folder) as text) & "Test") as alias
    tell application "System Events"
                   set fnames to (name of every file of source)
    end tell
    set AppleScript's text item delimiters to "."
    repeat with fname in fnames
              try
                   set folderName to text item 1 of fname
                   if folderName is not "" then
                    tell application "Finder"
                      if not (exists (folder folderName of source)) then
                          make new folder at source with properties {name:folderName}
                      end if
                     move file fname of folder source to folder folderName of source
                 end tell
           end if
        end try
    end repeat
    (the code formatting here really s*?ks. select all the text in the box and right click and select services make new AppleScript to get it into the editor)
    It's not very polished so be careful, setup some test folders and make sure it does what you want before using it on your live data.
    You need to set the
    set source to
    line to the path of the folder where the files are. You can do that as an absolute path ie "Macintosh HD:Users:etc" or using the path to as in the example.
    It is also not very efficient and there are many different ways to attack this problem. If this is a one time thing this will be fine. If it will be an ongoing situation you might want to describe exactly what is happening and other ways to solve the problem might be possible.
    As for learning AppleScript start with the Apple Development Site, especially AppleScript Language Guide.
    There are lots of sites out there with good info MacScripter being one of the better ones.
    Book wise I really like Learn AppleScript by Apress. Its good as both a tutorial and reference and has a good intro to AppleScript Objective-C (a way Apple ahs setup to allow AppleScripts to access pure objective-c code and the OS X GUI).
    good luck

  • Apex application file -upload and download a file.

    hi
    im having an issue with an application i created,its about uploading and downloading a file in application.the application is working and was able to upload and download a file but i have not idea there the file is stored in the application database,try to search for the file,its something dealing with the apex_application_file and i cant find it.
    Any idea where the file is stored?
    thnx
    nivesh

    Dear nivesh!
    If you upload a file into an APEX application the file is temporarily stored in the APEX_APPLICATION_FILES table. If you close your current application page the APEX_APPLICATION_FILES table will be cleared. You should create your own table to store files in a BLOB column. I've create an example for uploading images into an APEX application on apex.oracle.com. If you want to have a look at it please use the following credentials:
    Workspace: flo_demo
    Username: dev_null
    Password: password
    Application: 61811
    Yours sincerely
    Florian W.

  • How to upload and download any file from plsql through weblogic server

    hi all,
    how to upload and download any file from plsql through weblogic server? i am using oracle 10g express edition and jboss.
    Thanks and Regards,
    MSORA

    hi bala ,
    for a windown server u can use VNC (virtual network connection) which opens a session on u r desktop later u can drag and drop form there vice versa and for a linux box you can use Win SCP which helps to open a session with interface to u r desktop in both cases you can upload and down load files very easiy just as we drag and drop items in a simple pc .. we use the same technique...
    bye
    vamshi

  • How to upload  and download a files into AL11 directory in ABAP

    Hi,
                   How to upload  and download a files into AL11 directory in ABAP
    thanks
    Moderator message: please search for available information/documentation.
    Edited by: Thomas Zloch on Mar 21, 2011 9:18 AM

    You should try one of these forums for an answer to your question:
    http://swforum.sun.com/jive/forum.jspa?forumID=116
    http://community.java.net/netbeans
    http://linux.java.net

  • Bapi to upload and download the leave details

    Hi all,
          Can  u please tell me a bapi to upload and download the leave details for the infotype 2001.
    Thanks.

    Hi
    Warning! The API methods "Delete," "Approve," "Create," and "Request," and "Change," as well as their corresponding RFCs:
    <b>bapi_absence_delete
    bapi_absence_create
    bapi_absence_approve
    bapi_absence_request
    bapi_absence_change</b>
    are <b>no longer valid</b>. Using these APIs can create inconsistencies in time data.
    Instead, use the corresponding API Methods "ManageDelete," "ManageCreation," and "ManageChange" for the Business Object BUS7007, as well as the following corresponding RFCs:
    <b>bapi_ptmgrattabs_mngdelete
    bapi_ptmgrattabs_mngcreation
    bapi_ptmgrattabs_mngchange</b>
    Regards
    Raj

  • Two methods with same name but different return type?

    Can I have two methods with same name but different return type in Java? I used to do this in C++ (method overloading or function overloading)
    Here is my code:
    import java.io.*;
    public class Test{
    public static void main(String ar[]){
    try{          
    //I give an invalid file name to throw IO error.
    File file = new File("c:/invalid file name becasue of spaces");
    FileWriter writer = new FileWriter(file ,true);
    writer.write("Test");
    writer.close();     
    } catch (IOException IOe){
         System.out.println("Failure");
    //call first method - displays stack trace on screen
         showerr(NPe);
    //call second method - returns stack trace as string
            String msg = showerr(NPe);
            System.out.println(msg);
    } // end of main
    public static void showerr(Exception e){
         StringWriter sw = new StringWriter();
         PrintWriter pw = new PrintWriter(sw);
         e.printStackTrace(pw);
         try{
         pw.close();
         sw.close();
         catch (IOException IOe){
         IOe.printStackTrace();     
         String stackTrace = sw.toString();
         System.out.println("Null Ptr\n" +  stackTrace );
    }//end of first showerr
    public static String showerr(Exception e){
         StringWriter sw = new StringWriter();
         PrintWriter pw = new PrintWriter(sw);
         e.printStackTrace(pw);
         try{
         pw.close();
         sw.close();
         catch (IOException IOe){
         IOe.printStackTrace();     
         return sw.toString();
    }//end of second showerr
    } // end of class
    [\code]

    Overloading is when you have multiple methods that have the same name and the same return type but take different parameters. See example
    public class Overloader {
         public String buildError(Exception e){
              java.util.Date now = new java.util.Date() ;
              java.text.DateFormat format = java.text.DateFormat.getInstance() ;
              StringBuffer buffer = new StringBuffer() ;
              buffer.append(format.format(now))
                   .append( " : " )
                   .append( e.getClass().getName() )
                   .append( " : " )
                   .append( e.getMessage() ) ;
              return buffer.toString() ;
         public String buildError(String msg){
              java.util.Date now = new java.util.Date() ;
              java.text.DateFormat format = java.text.DateFormat.getInstance() ;
              StringBuffer buffer = new StringBuffer() ;
              buffer.append(format.format(now))
                   .append( " : " )
                   .append( msg ) ;
              return buffer.toString() ;
         public String buildErrors(int errCount){
              java.util.Date now = new java.util.Date() ;
              java.text.DateFormat format = java.text.DateFormat.getInstance() ;
              StringBuffer buffer = new StringBuffer() ;
              buffer.append(format.format(now))
                   .append( " : " )
                   .append( "There have been " )
                   .append( errCount )
                   .append( " errors encountered.")  ;
              return buffer.toString() ;
    }Make sense ???
    Regards,

  • How to upload and Download the file in a system through java programing

    I am trying to upload a file as well as want to download the uploaded file in my system....I don't have any server an all.
    I want to implement this in my system only .
    I got this code but i don't know ,where i have to make the change and what are the parameters i have to pass.
    can any one help me on this code ....please
    here some piece of code
    File Upload and Download Code Example
    package com.resource.util;
    public class FileUpload
    public void upload( String ftpServer, String user, String password,
    String fileName, File source ) throws MalformedURLException,
    IOException
    if (ftpServer != null && fileName != null && source != null)
    StringBuffer sb = new StringBuffer( "ftp://" );
    // check for authentication else assume its anonymous access.
    if (user != null && password != null)
    sb.append( user );
    sb.append( ':' );
    sb.append( password );
    sb.append( '@' );
    sb.append( ftpServer );
    sb.append( '/' );
    sb.append( fileName );
    * type ==> a=ASCII mode, i=image (binary) mode, d= file directory
    * listing
    sb.append( ";type=i" );
    BufferedInputStream bis = null;
    BufferedOutputStream bos = null;
    try
    URL url = new URL( sb.toString() );
    URLConnection urlc = url.openConnection();
    bos = new BufferedOutputStream( urlc.getOutputStream() );
    bis = new BufferedInputStream( new FileInputStream( source ) );
    int i;
    // read byte by byte until end of stream
    while ((i = bis.read()) != -1)
    bos.write( i );
    finally
    if (bis != null)
    try
    bis.close();
    catch (IOException ioe)
    ioe.printStackTrace();
    if (bos != null)
    try
    bos.close();
    catch (IOException ioe)
    ioe.printStackTrace();
    else
    System.out.println( "Input not available." );
    }

    At least that is what the code you posted suggests to me.It looks like that to me too.
    I believe that
    URLConnection urlc = url.openConnection(url);Will return you an FTP URLConnection implementation if you pass it a ftp:// url
    So for simple FTP ops, you don't need any external libs.
    Actually, looking at your code, this is already what you are doing, so I really don't get this:
    am not using FTP server..... i want to implement in my system only ....So How i will do.
    Can you give me any idea based on this code Can you explain a bit more what you need?
    patumaire

  • To upload and download any file to the server

    Hi,
    I want to upload and download files into and from the server; as we do it in yahoo attachments. Give the location of the file, click upload, it must upload the file to the web server and click on the uploaded file, it should get downloaded. i want to do this in Application server.
    Can anyone help me on this please......
    Thanks in advance,,
    Bala

    hi bala ,
    for a windown server u can use VNC (virtual network connection) which opens a session on u r desktop later u can drag and drop form there vice versa and for a linux box you can use Win SCP which helps to open a session with interface to u r desktop in both cases you can upload and down load files very easiy just as we drag and drop items in a simple pc .. we use the same technique...
    bye
    vamshi

  • Two AM's with the same name but different forms causes Deployment problems

    Two Masters forms, DOC & PM are cloned except for the "where clause" in the View's query and the titles in their JSP's.
    DOC workspace has a BC project and a BC4JSP Project. The BC project comprises of the EO and VO named ComVsStaticValue. In the Edit prop-> query for the VO I have specified the "where clause" as VSSV_VS_CODE='DOCTOR'.
    In Java Webserver :-
    The JSP's are located in C:\source\Doctor\ .. and the *.xml and *.class files generated by the BC proj is in C:\source\Doctor\pol_ValueSet\..
    If I execute Doctor in JWS the records are getting filtered properly.
    PM workspace has a BC project and a BC4JSP Project. Again The BC project comprises of the EO and VO named ComVsStaticValue. In the Edit prop-> query for the VO I have specified the "where clause" as VSSV_VS_CODE='PAY_MODE'.
    In Java Webserver :-
    The JSP's are located in C:\source\PMode\ .. and the *.xml and *.class files generated by the BC proj is in C:\source\PMode\pol_ValueSet\..
    If I execute PM in JWS, the PM's JSP comes (the title is correct) but the records pertaining to DOC appears. I checked the View's xml file in C:\source\PMode\pol_ValueSet\ the "where clause" is correct. The xml & classes have the same name but their contents are different.
    I want to know whether this problem is because both have the same name for the AM and the BC4JSP's property file.
    Please clarify.

    Deploying two app modules with the same name will definitely cause problems.
    The JSPs use the information in the properties file to connect to the application module and get the data they need from the appropriate View Objects in those app modules. If you have two app modules with the same name, when a JSP tries to connect, it has no way of knowing which one of the app modules to connect to if they both have the same name.
    You could:
    1. Just use one application module that contains all the View Objects you need to access.
    or
    2. Rename one of the application modules or the package it is located in so the names are distinct. If you choose this method, you will also need to update the JSPs (specifically the 'registerApplicationFrompPopertyFile' method call), and your JSP project's appmodule property file.

  • Why can't iTunes down load two songs with the same name but different artists to my iPhone?

    I noticed this a couple of years ago but had forgotten about it. Today I purchased two songs, both called Bop Gun (One Nation) but by different artists. When I looked at the purchased list on one appears. If I go back to iTunes and download the other one, the former disappears. Are they honestly saying that these phones are intelligent enough to distinguish a song by artist rather than track listing?
    Epic Fail!!!

    Usually a song is uniquely identified by song name, artist, album and track number. That said internally I suspect the iTunes Store may allow one song to appear on more than one album while they only need to store one copy of the audio data. (They must also be able to cope with the situation, for example, where the UK & US version of an album have a different track order). It is also possible there is an error in the database that means you're not getting the song you're expecting. If you can't successfully download the two (presumably) different versions of the song then use the report a problem links in your account history and explain the issue. Hopefully the iTunes Store support staff can get it resolved.
    tt2

  • How to upload and download a file in server side program

    Give me a sample code for the file upload and download using Server side program.

    You should try one of these forums for an answer to your question:
    http://swforum.sun.com/jive/forum.jspa?forumID=116
    http://community.java.net/netbeans
    http://linux.java.net

  • Upload and Download of files

    I am working on a web site development work. I am working with STRUTS framework tht is made over the jsp tag library..Can any one help me about how to upload and download files from server and to the server.If possible using struts framework. Pls do give a pratical example..
    regards jay

    Like this:
            //upload
            String fileName = formFile.getFileName();
         Sting  destFile = "c:/upload/" + fileName;//path to save the upload file on server
         try {
                 InputStream     in = formFile.getInputStream();
              OutputStream     out = new FileOutputStream( new File(destFile) );
              int n = 0;
              byte[] buff = new byte[8192];
              while( (n = in.read( buff, 0, 8192 )) != -1 ) {
                   out.write( buff, 0, n );
              out.close();
              in.close();     
            }catch(Exception e){
            //download
            String serverFile = "c:/upload/a.txt";//file path on server to be downloaded
            File serverF = new File(serverFile);
            response.setContentType("text/html");
         response.setHeader("Content-Disposition","attachment;filename="+serverF.getFileName()+";");
         try {
             ServletOutputStream outStream = response.getOutputStream();
             FileInputStream stream = new FileInputStream(serverF);
             BufferedInputStream  bis = new BufferedInputStream(stream);
             BufferedOutputStream bos = new BufferedOutputStream(outStream);
             byte[] buff = new byte[2048];
             int bytesRead;
                try{
                 while(-1 != (bytesRead = bis.read(buff, 0, buff.length))) {
                      bos.write(buff, 0, bytesRead);
             } catch (Exception e) {
                } finally {
            if (bis != null) bis.close();
            if (bos != null) bos.close();
            if (stream != null) stream.close();
         }catch (IOException e){
         }

Maybe you are looking for

  • Error in sender adapter in FCC from flatfile to xml

    Hello Masters, Please reply me for this error. I am attaching the necessary documents as below - Error - Cannot create target element. Values missing in queue context. Message Mapping - Content Conversion Parameters - Flat File to be converted to XML

  • Create a pdf that is readable only in Adobe Reader

    Hi! I have an interactive pdf that i want the users to be able to read in Adobe Reader or Acrobat Pro since it's the only reader that can handle it correctly. Is this possible? Many users have for example Preview on Mac as the default reader and it d

  • Itunes Error 42404- corepf.pkg install fail

    The Corepf.pkg in the itunes installer is failing to install, causing me to not be able to authorize my itunes account and preventing me from installing apps on my iphone and playing downloaded music. The pkg gets about 80% of the way through the ins

  • LMS 3.2 on Solaris 10 - New devices and RME archive job

    Hi All, I've created a RME job that archive syncs our devices. When I add new devices to Common Services, which updates RME, will those new devices have their configurations archived by that same RME job, or do I need to create a new job? When the ex

  • Help retrieving window sizing side/corner in Linux

    I'm coding in CVI 8.1 and using the 2010 RTE for Linux.  In Linux, EVENT_PANEL_SIZE fires multiple times instead of EVENT_PANEL_SIZING (as it is in Windows).  The problem is that the EVENT_PANEL_SIZE event doesn't provide any callback data in either