How to set the file transfer mode to binary

Hi,
I have a requirement to upload files from local machine to server, and it is working fine.
But after uploading files junk characters are entered after each line, so want to set the file transfer mode to binary to get rid from this error.
We have checked that if we ftp the files manually then also getting the same problem when the transfer mode is not selected as binary.
Please give your valuable advice.
Thanks,
Ranita

Hi,
I want to set the file transfer mode through controller code, presently I am using the below code where no file transfer mode is specified ::
public void upLoadFile(OAPageContext pageContext,OAWebBean webBean)
  String serverPath = null;
  OAApplicationModuleImpl am = (OAApplicationModuleImpl)pageContext.getApplicationModule(webBean);
   try {              
      Connection conn = am.getOADBTransaction().getJdbcConnection();     
      String query = "select  distinct variable_name, value from fnd_env_context where variable_name = 'XXCUST_TOP' and concurrent_process_id = ( select max(concurrent_process_id) from fnd_env_context )";
      PreparedStatement stmt = conn.prepareStatement(query);
       for (ResultSet resultset = stmt.executeQuery();
                      resultset.next(); )
             serverPath  = resultset.getString("value");
        stmt.close();  
       catch(Exception ex)
         throw new OAException(ex.getMessage(), OAException.ERROR);
   String filePath = serverPath+"/"+pageContext.getParameter("FileType");
   //System.out.println("Default File Path---->"+filePath);
   String fileUrl = null;
   try
    DataObject fileUploadData =  pageContext.getNamedDataObject("MessageFileUpload");
  //FileUploading is my MessageFileUpload Bean Id
    if(fileUploadData!=null)
     String uFileName = (String)fileUploadData.selectValue(null, "UPLOAD_FILE_NAME"); 
     String contentType = (String) fileUploadData.selectValue(null, "UPLOAD_FILE_MIME_TYPE");  
     //System.out.println("User File Name---->"+uFileName);
     FileOutputStream output = null;
     InputStream input = null;
     BlobDomain uploadedByteStream = (BlobDomain)fileUploadData.selectValue(null, uFileName);
     //System.out.println("uploadedByteStream---->"+uploadedByteStream);
     File file = new File(filePath, uFileName);   //C:\\Ranita
     //System.out.println("File output---->"+file);
     output = new FileOutputStream(file);
     //System.out.println("input---->"+input);
     byte abyte0[] = new byte[0x19000];
     int i;
     while((i = input.read(abyte0)) > 0)
     output.write(abyte0, 0, i);
     output.close();
     input.close();
     HashMap map = new HashMap();
     map.put("fromPage","Y");
     pageContext.forwardImmediatelyToCurrentPage(map,true,OAWebBeanConstants.ADD_BREAD_CRUMB_YES);
   catch(Exception ex)

Similar Messages

  • How to set the Data Synchronisation mode for ADF BC component?

    Hi All,
    How to set the Data Synchronisation mode for ADF BC component
    Thanks
    Raghavendra

    Can you clarify what you mean by the data synchronization mode?
    If you mean the Sync Mode, then in 10.1.3 you set this property by:
    1. Selecting your DataBindings.cpx file
    2. Expanding the "Data Control Usages" section in the structure window
    3. Selecting the ADFBC-based data control
    4. Setting the "syncMode" property in the property inspector.

  • Can't find how to shut off File Transfer Mode with...

    I've spent the better part of two hours searching the Internet for information on how to turn off File Transfer Mode since my phone started refusing to connect to my home computer, today.
    The pdf user's guide doesn't say how to find it.  I've been digging through the menu on the phone trying to find anything that resembles File Transfer Mode so I can click it off.
    The other FAQ and discussion groups I've located are irrelavent as the information they contain doesn't transfer to my Nokia 820 (they suggest options which don't exist on my phone).
    Please, where does one start looking for File Transfer Mode on this phone so they can shut it off, and why isn't that information printed in the troubleshooting documents and self help files for these phones?
    I connect through the USB cable to my PC.  I have downloaded and installed Nokia PC Suite v.7.1.180.94 this morning in hopes that it would fix the connectivity problem, but unless I can get File Transfer Mode shut off somehow, my new phone's going to wind up being useless.
    Nokia Lumia 820, Windows 8 phone
    HP Pavilion Slimline s52021, Windows 7 Home

    have you searched these forums and tried a soft reset (pressing the volume down and power buttons together until the phone vibrates)? Bear in mind that no, Nokia Suite, or Nokia PC Suite do not work with Windows Phone 8 devices at all, only the Windows Phone app does.
    See if other devices connect to your PC, and try other USB ports.

  • How to set the file path dynamically based on sytem, username, and date

    Hi All,
    My requirement is upload the data into one  structure like xyz that is related to t.code MCSZ.
    file will be in  UNIx SERVER .
    PATH IS: /sapif
    file name is xy789 load .txt
    I have  to write code in one user-exit
    how can i set the file path for this.
    shall i put hard code file path?
    because i have to writecode in user-exit.
    plz tell me how to set the file path based ons syetem, username, date
    Thanks in advance
    Ram.A

    Concatenate the field SY-SYSID, SY-UNAME and SY-DATUM for the file path

  • How to set the full screen mode using setClip method

    hi all,
    how to set the full screen mode using setClip in that softkeys should not be used insteat on that need to create a own softkeys using commands.
    thanks & regards
    Bala.

    In CS5 there are changes made to how the screen mode is reported. In CS3-CS5 the screen mode has a corresponding number. So for instance if the ScreenMode is set to "Preview Off" and you ask indesign CS3 or CS4 to display the screen mode, it will report "1936552047", while in CS5 it will report "PREVIEW_OFF".
    try executing this simple command in respectively CS3, CS4 and CS5 and you will see what I am talking about:
    alert(app.activeWindow.screenMode);
    there is no difference if you do:
    alert(app.activeDocument.layoutWindows[0].screenMode);
    The CS5 solution is rather awkward to work with, unless I am missing something? PREVIEW_OFF is not a string, nor is it a number.
    Example -  doing:
    myScreenMode=app.activeDocument.layoutWindows[0].screenMode;
    and then trying to reset screenMode by something like:
    app.activeDocument.layoutWindows[0].screenMode= myScreenMode
    does not work in CS5 of course. It will throw an error. Neither will this line work:
    app.activeDocument.layoutWindows[0].screenMode=ScreenModeOptions.myScreenMode;
    Any way of working around this?

  • How to set the File Path to run a javascript using Plugin Code?

    Hi All,
    Im new to Indesign Plugin Development.Can any one help me out with my problem.
    What i want to do is to run a javascript using Plugin Code.When i went through this forum i was able to find out that i should use the IscriptRunner Class to automate this.I could also figure out that the Member Function to use is "CanHandleFile" &"RunFile".
    The first parameter in CanHandleFile & RunFile Member Function is to specify the path of the JavaScript File i suppose!I could also find out that IDFile has to used to set the file path Information.
    But im clueless how to set the Javascript FilePath using IDFile.Can any one help me how to do this?Any Code Snippets Please?
    Waiting for reply.
    Thanks
    myRiaz

    Hi,  Andreas<br /><br />  Can you explain this in detail? I found it in your post before.<br /><br />  The content of elements are returned through the Characters callback function:<br /><br />From ISaxContentHandler.h:<br /><br />/**<br />        Receives character data<br /><br />The parser will call this method to report each chunk of<br />        character data. SAX parsers may return all contiguous<br />        character data in a single chunk, or they may split it into<br />        several chunks. But all characters in any single<br />        event must come from the same external entity so the<br />        Locator provides useful information.<br /><br />Note some parsers will report whitespace using the<br />        IgnorableWhitespace() method rather than this one (validating<br />        parsers must do so).<br /><br />@param Chars The characters from the XML document.<br />        */<br />virtual void Characters(const PMString& chars) = 0; <br /><br />  What i have done is implement my own SAXContentHandlerServiceBoss, and in my file XXXSAXContentHandler.cpp, I override the fonctions StartElement, EndElement, and Characters() like below: I add the PMString xmlData to collect the file content:<br /><br />class XXXSAXContentHandler : public CSAXContentHandler<br />{<br />void XXXSAXContentHandler::Characters(const WideString& chars)<br />{<br />xmlData.Append(chars);<br />}<br /><br />void XXXSAXContentHandler::StartElement(const WideString& uri, const WideString& localname, const WideString& qname, ISAXAttributes* attrs)<br />{<br />xmlData.Append("<"); xmlData.Append(localname); xmlData.Append(">");<br />}<br />void XXXSAXContentHandler::EndElement(const WideString& uri, const WideString& localname, const WideString& qname)<br />{<br />xmlData.Append("</"); xmlData.Append(localname); xmlData.Append(">");<br />}<br /><br />}<br /><br />and in my program, I use the code below to call the fonction I overrided, but I dont know how I can get the String xmlData I defined in the XXXSAXContentHandler.cpp<br /><br />InterfacePtr<IK2ServiceRegistry> serviceRegistry(gSession, UseDefaultIID());<br /><br />InterfacePtr<IK2ServiceProvider> xmlProvider(serviceRegistry->QueryServiceProviderByClassID(kXMLParserService, kXMLParserServiceBoss));<br /><br />InterfacePtr<ISAXServices> saxServices(xmlProvider, UseDefaultIID());<br />InterfacePtr<ISAXContentHandler> saxHandler(::CreateObject2<ISAXContentHandler>(kXXXSAXContentHandlerServiceBoss));<br />saxHandler->Register(saxServices);<br />bool16 parseFailed = saxServices->ParseStream(readStream, saxHandler);<br /><br />Can you give me any help?<br /><br />Thanks and regards!

  • How to see the  file transfer speed on a mac

    Hi, I'm kind of a beginner with a Mac, I have worked on windows for all this years and now I have a small dilema. Can someone please tell me how you can see the file transferring speed on a mac. When you copy and paste from one drive to another, or from time capsule to my mac, etc a dialog appears showing you a progress bar and the time remaining. I would also like to see the speed of the transfer. Is it posible to see this variable?

    In windows - vista when you copy or paste a folder from one location to another in the file transfer pop-up you can see the speed of the transfer.(You must press the more details arrow on that pop-up). Does Leopard has any configuration for this kind of information.
    I will try iGet and write here my feedback.

  • How to set the right filter mode?

    Hi All,
    I have a few applications deployed in Tomcat 5.5.9 for which i need to control access.
    I have created a policy to which I have added a rule of type URL Policy Agent and added a few users as subjects.
    Now that the policy is in place, I tried to change the filter.mode property in AMAgent.properties file to all the possible options and I have noticed the following:
    filter.mode=NONE              Allows all users without authentication
    filter.mode=SSO_ONLY          Allows all users after authentication against DS
    filter.mode=URL_POLICY          Disallows authentic users also (HTTP 403 error)
    filter.mode=J2EE_POLICY          Allows all users after authentication against DS
    filter.mode=ALL                      Disallows authentic users also (HTTP 403 error)
    In my case all the observations except the J2EE_POLICY option work as required.
    I conclude this as a part of my understanding gained through the following:
    http://docs.sun.com/source/816-6884-10/chapter3.html#wp21908
    I have failed to understand why the J2EE_POLICY option allows users which are not included as subjects in the realm as authentic.
    I have also tried setting the com.sun.am.policy.agents.do_sso_only=false property but dint get things working as needed.
    Any help in this regard would be appreciated.
    Regards,
    Saiesh Nayak,
    Persistent Systems.

    J2ee_policy allows users which are not included as subjects in the realm because the policy agent actually doesn't validate the URL policies configured in AM, it just validate j2ee declarative security from your web application.
    So, as I suspect, if you don't have security constraints in your webapp, you won't enforce security.
    With URL_POLICY option, you will enable url policy evaluations as you configure it in Access Manager. So, in this case and in the ALL option case, check that the url policy is correctly configured, mainly the rule.
    You can enable debug.level=message instead of debug.level=error in AMAgent.properties in order to see what's happening. When you enable message level debug, the agent will create some debug log files, please take a look on the amFilter and amWebPolicy log files.
    Hope it helps.

  • How to set the file.encoding in jvm?

    I have some error in showing Chinese by used servlet,
    some one tole me that I can change the file.encoding in jvm to zh_CN, how can I do that?

    Add the java argument in your servlet engine.
    e.g
    java -Dfile.encoding=ISO8859-1
    garycafe

  • How to set the the file selection mode of JFileChooser

    hi,
    i want to set the file selection mode to directories only for JFileChooser class but when i run the code it does not select the folder adn opens the folder instead. i want the user to select a folder from the file system . any ideas?

    Sorry, I misunderstood you question. I thought that you already set it to choose Directories and wondered when you can't select them when you double-click.
    use JFileChooser.setFileSelectionMode(int). This should solve your problem.
    Here is an example:
            JFileChooser jf = new JFileChooser();
            jf.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
            jf.showDialog(this, "Select");
            System.out.println(jf.getSelectedFile());
    unformatted
    JFileChooser jf = new JFileChooser();
    jf.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    jf.showDialog(this, "Select");
    System.out.println(jf.getSelectedFile());

  • Setting File transfer mode in SFTP using JSch (jsch-20070302.jar)

    Hi,
    I use Jsch for downloading and uploading files via SFTP. I am a facing a problem in the file transfer mode. When I download or upload manually the files seems file, but when I use my code to download or upload there is some problem. Actally the file has to be transferred in ASCII mode, but the code transfers it in binary mode. Below is the code I am using
    +import com.jcraft.jsch.*
    Session session = null;
    try {
    populateProperties();
    log("INFO","Download and Encrypt Program started",getDateTime());
    JSch jsch = new JSch();
    String host = tumbleweedURL;
    String user = tUserid;
    session = jsch.getSession(user, host, 22);
    session.setUserInfo(new MyUserInfo());
    session.setPassword(tPassword);          
    session.connect();
    Channel channel = session.openChannel("sftp");
    channel.connect();
    ChannelSftp c = (ChannelSftp) channel;
    c.cd("outbox");
    c.get("8",outFolderPath);
    }+
    Please tell me how I change the transfer mode to ASCII for the above code

    Vignesh_kumar wrote:
    I am not sure where to put this question, I have tried a lot of things and I am not able to find a solution for this. Will you be able to guide me..A mailing list, or forum, or faq, or support address at JCraft, maybe?

  • How to set a file in uploadrequest ??

    hello
    I want to upload a file. In the request I have the path of the file
    // my.jsp
      String filepath = request.getParameter(filepath);
      <html:form action=/Upload  method="post"  enctype="multipart/form-data">
       <html:hidden property="filepath" value='<%=filepath%>'/>
    </html:form>
      // in the MyUploadAction class
       boolean isMultipart = FileUpload.isMultipartContent(request);  // true
       DiskFileUpload upload = new DiskFileUpload();
       List items = upload.parseRequest(request);
       Iterator iter = items.iterator();
        while (iter.hasNext()) {
                System.out.println("print somthing");
      problem:
         -   iter is empty  // iter.hasNext()    ----->   false
             how to set the file in the request ????
           / /note:  I want not to use  uploadAction from struts because of designingthanks

    The following blog post provides a way to create a document set using ECMA:
    http://blogs.msdn.com/b/mittals/archive/2013/04/03/how-to-create-a-document-set-in-sharepoint-2013-using-javascript-client-side-object-model-jsom.aspx
    The following blog post provides a way to upload files into a document set using CSOM:
    http://www.c-sharpcorner.com/Blogs/12139/how-to-create-document-set-using-csom-in-sharepoint-2013.aspx
    See if you can follow the logic in the CSOM example to apply it to ECMA. Let me know if you have specific problems with it.
    Dimitri Ayrapetov (MCSE: SharePoint)

  • Hi, i purchased a 2 dvd digital set. i cant just download it straight to my ipad. they said i have to down load it to my i tunes, then can transfer to i pad. im not seeing how to click the files from my email, and get them into the i tunes acct... ugh.

    hi, i purchased a 2 dvd digital set. i cant just download it straight to my ipad. they said i have to down load it to my i tunes, then can transfer to i pad. im not seeing how to click the files from my email, and get them into the i tunes acct... ugh.
    i do not have a mac home pc. just a regular pc

    I had the same problem after I gave my old iPad to my parents and tried to install Netflix. This is what you have to do:  Open iTunes on your computer, the one you sync your iPad to. Then go to iTunes Store and search for and download Netflix app. After you download it, if your iPad is set to download new purchases it may start downloading on your iPad. If so, tap and hold to delete the app (because it is trying to install the new version on the iPad) Next step, go to the App Store on your iPad and find Netflix and it should say install since you already purchased it on the computer. Tap to install, and it will say the version is not compatible, tap to download a previous version. Click that and it will install the older version!    One more thing, if and when you sync to your computer again it will say something like " Unable to install Netflix on your iPad" Just click the box to never remind you again, because it's trying to sync the newer Netflix app to your iPad, but it doesn't work so it displays the message. The old app will remain on the ipad. Hope this helps, good luck

  • How to set the classloader mode in Netweaver 04s

    Hi All,
    Can anybody tell me how to set classloader mode in Netweaver 04S?
    In websphere , there is direct option you when you select the project through admin console. But I am able to find the place in the netweaver where I can set such mode.
    classloader mode such as parentfirst, parent last etc
    I want to set the mode parent last.
    This is very urgent requirenment.So please let me know if anybody is having any input on this.
    Thanks,
    Chandan

    Hi Siddhesh,
    Thanks for replying.
    Actually,NW has its own version of jaxrpc related jar files (in  <drive>:\usr\sap\J2E\JC02\j2ee\cluster\server0\bin\ext\webservices_lib folder) which are of a older version and are being picked up instead of the jars that are present in my application package. As a result, there are exceptions like:
    #1.5#0018FE710E98005B000000000000182800044D0B9F1ED11B#1210612216444#System.err#tdemand.com/TrueDemandWeb#System.err#Guest#0#####Thread[Thread-271,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Error##Plain###java.lang.NoSuchMethodError: javax.xml.namespace.QName.getPrefix()Ljava/lang/String;#
    #1.5#0018FE710E98005B000000010000182800044D0B9F1ED31A#1210612216444#System.err#tdemand.com/TrueDemandWeb#System.err#Guest#0#####Thread[Thread-271,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Error##Plain###       at org.apache.axis.wsdl.symbolTable.BackslashUtil.getQNameWithDifferentLocal(BackslashUtil.java:62)#
    #1.5#0018FE710E98005B000000020000182800044D0B9F1ED379#1210612216444#System.err#tdemand.com/TrueDemandWeb#System.err#Guest#0#####Thread[Thread-271,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Error##Plain###       at org.apache.axis.wsdl.symbolTable.BackslashUtil.getQNameWithBackslashlessLocal(BackslashUtil.java:39)#
    #1.5#0018FE710E98005B000000030000182800044D0B9F1ED3D3#1210612216444#System.err#tdemand.com/TrueDemandWeb#System.err#Guest#0#####Thread[Thread-271,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Error##Plain###       at org.apache.axis.wsdl.symbolTable.SymbolTable.populateServices(SymbolTable.java:3078)#
    #1.5#0018FE710E98005B000000040000182800044D0B9F1ED42B#1210612216444#System.err#tdemand.com/TrueDemandWeb#System.err#Guest#0#####Thread[Thread-271,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Error##Plain###       at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:745)#
    #1.5#0018FE710E98005B000000050000182800044D0B9F1ED481#1210612216444#System.err#tdemand.com/TrueDemandWeb#System.err#Guest#0#####Thread[Thread-271,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Error##Plain###       at org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:543)#
    #1.5#0018FE710E98005B000000060000182800044D0B9F1ED4D8#1210612216444#System.err#tdemand.com/TrueDemandWeb#System.err#Guest#0#####Thread[Thread-271,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Error##Plain###       at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:518)#
    #1.5#0018FE710E98005B000000070000182800044D0B9F1ED52F#1210612216444#System.err#tdemand.com/TrueDemandWeb#System.err#Guest#0#####Thread[Thread-271,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Error##Plain###       at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495)#
    #1.5#0018FE710E98005B000000080000182800044D0B9F1ED585#1210612216444#System.err#tdemand.com/TrueDemandWeb#System.err#Guest#0#####Thread[Thread-271,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Error##Plain###       at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)#
    #1.5#0018FE710E98005B000000090000182800044D0B9F1ED5E1#1210612216444#System.err#tdemand.com/TrueDemandWeb#System.err#Guest#0#####Thread[Thread-271,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Error##Plain###       at java.lang.Thread.run(Thread.java:534)#
    #1.5#0018FE710E98004F00001A610000182800044D0B9F1F2B60#1210612216475#System.out#tdemand.com/TrueDemandWeb#System.out#Guest#0#####SAPEngine_Application_Thread[impl:3]_9##0#0#Info##Plain###2008-05-12 10:10:16,459 ERROR [com.tdemand.common.service.client.ServiceProxyUtil] - <Error processing WSDL document: 
    javax.xml.rpc.ServiceException: Error processing WSDL document: 
    javax.xml.rpc.ServiceException: Cannot find service:  BootstrapService>
    javax.xml.rpc.ServiceException: Error processing WSDL document: 
    javax.xml.rpc.ServiceException: Error processing WSDL document: 
    javax.xml.rpc.ServiceException: Cannot find service:  BootstrapService
                at org.apache.axis.client.Service.initService(Service.java:250)
                at org.apache.axis.client.Service.<init>(Service.java:165)
                at org.apache.axis.client.ServiceFactory.createService(ServiceFactory.java:198)
                at org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory.createJaxRpcService(LocalJaxRpcServiceFactory.java:182)
    This problem is solved in websphere as probably because we have classloader configuration set through Admin console.
    But just wanted to know does we have such option in NetWeaver? If yes, how to set the classloader mode to parent last.
    Or if you know some other solution then let me know.
    Thanks,
    Chandan

  • How to set default file extension in the FileChooser?

    We are trying to use the FileChooser but for some reason, it doesn't have any file extensions in the drop down menu (like in windows). Does anyone know how to put this in?
    Also, how do we set the file name for the saving file, rather than typing the name in ourself?
    Also, how do we position the file chooser dialog in the middle of the screen? Right now, it's in the top left corner of the screen.
    Here's our piece of code, used for saving file.
    FileChooser fileChooser = new FileChooser();
            File file = fileChooser.showSaveDialog(stage);
            /*User might clicked on the cancel button*/
            if (file != null) {
                try {
                    Writer output = new BufferedWriter(new FileWriter(file));
                    output.write(text);
                    output.close();
                } catch (IOException ex) {
                    logger.error("save file error", ex);
            }Any help would be appreciated! Thanks!

    867511 wrote:
    We are trying to use the FileChooser but for some reason, it doesn't have any file extensions in the drop down menu (like in windows). Does anyone know how to put this in?Have you read the API? What's the nested class of FileChooser that's listed immediately after it in the classes list?
    Also, how do we set the file name for the saving file, rather than typing the name in ourself?I don't see any API for that. You could file a RFE on kenai.
    Also, how do we position the file chooser dialog in the middle of the screen? Right now, it's in the top left corner of the screen.I don't see any API for that either.
    db

Maybe you are looking for