File upload through BlazeDS remote object?

Hi,
After researching file upload options in flex, it seems like the only option is through HTTP service requests, such as:
private var fileRef:FileReference;
fileRef.upload(new URLRequest(FILE_UPLOAD_URL));
Is there any way to use BlazeDS remote objects to upload a file from Flex interface? Perhaps passing in a FileReference object and marshalling it into an equivalent Java object?
Thanks!

I know there is a workaround like this. It uses a servlet to upload a file and returns a url. The uploaded file is either stored in session or server file system until the session expires. Use the PropertyProxy to register a custom class which contains this url and convert to java.io.File. It is the limitation of the player. It cannot read the local file system for security reason. There is a sample in blazeds/trunk/qa/apps/qa-regress/WEB-INF/src/blazeds/qa/remotingService/Echo.java
static
PropertyProxyRegistry registry = PropertyProxyRegistry.getRegistry();
PropertyProxy proxy = registry.getProxy(java.io.File.class);
if (proxy == null)
registry.register(java.io.File.class, new FileProxy());
proxy = registry.getProxy(FileReference.class);
if (proxy == null)
registry.register(FileReference.class, new FileReferenceProxy());
Hope it can help

Similar Messages

  • Flat file upload through BPS webinterface

    Hi ,
    I want to load a flat file ( format in CSV) through web upload  into a master data infoobject.
    that is i want to upload through BPS webinterface . (3.5 version)
    Is it possible to write everything in a BSP application without the help of Planning level or layout or functions.
    but only through webinterface and a BSP application and can abap coding be included in directly in .htm page.
    kindly help me out.

    Hi,
    I don't think so you 'll be able to write the abap code directly in htm page.Web interfaces are used for the purpose of creating and using user interface .It is no where linked to the logic or the activity that has to be performed using abap code directly.
    You have to use the planning level and planning function for uploading the data through flat file.You can check the How to guide in forum's.
    You can also create Transaction code for uploading the master data,through abap code you can provide buttons to upload it.
    Regards,
    Indu

  • Help needed...   File UPload  problem on remote Machine..

    Hello Helpers....
    Advance My heartfull thanks
    me have problem in file uploading...
    me have program for file upload...
    but it will work perfectly in same system.. (i mean server)..
    i cant upload in client machine..
    resourse not found (error) is comming
    me use tomcat5.0 with jdk1.4..
    Html File
    <html>
    <head>
    <form action="fileupload.jsp" name="upform" enctype="multipart/form-data">
    <table width="60%" border="0" cellspacing="1" cellpadding="1" align="center" class="style1">
    <tr>
    <td align="left"><b>Select a file to upload :</b></td>
    </tr>
    <tr>
    <td align="left">
    <input type="file" name="filename" size="50">
    </td>
    </tr>
    <tr>
    <td align="left">
    <!-- <input type="hidden" name="todo" value="upload"> -->
    <input type="submit" name="Submit" value="Upload">
    <input type="reset" name="Reset" value="Cancel">
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>
    jsp file
    <%@ page import="java.util.*,java.io.*"%>
    <%
    String path=request.getParameter("filename");
    String newPath="";
    int count=0;
    if(path!=null)
         ArrayList arr=new ArrayList();
         StringTokenizer st=new StringTokenizer(path,"\\");
         while(st.hasMoreTokens())
              arr.add(count,st.nextToken());
              count++;
         // create ur own path
         newPath="//javaserver/Tomcat5.0/webapps/ROOT/fileupload/fl/"+arr.get(count-1);
         int c;
         FileInputStream fis=new FileInputStream(path);
         FileOutputStream fos=new FileOutputStream(newPath);
         while((c=fis.read())!=-1)
              fos.write((char)c);
    out.println("Thanks for using");
    out.println("<br>");
    out.println("<br>");
    out.println("1.File1 Uploaded from :: "+path);
    out.println("<br>");
    out.println("<br>");
    out.println("2.Uploaded File1 is Saved in :: "+newPath);
    %>
    Message was edited by:
    drvijayy2k2
    Message was edited by:
    drvijayy2k2

    hai mshanu...
    thus me asking whats wrong any other solution..
    thanks for ur ........................
    Message was edited by:
    drvijayy2k2

  • File upload through web server to weblogic

    WAS: Weblogic 10.3
    Web Server: Sun One Web Server 6.1
    JDK: 1.4
    I've deployed a web application(*.war) to weblogic server, and try to upload a file through sun one web server(webserver) to the weblogic. The 'webserver' does nothing but bypass the request to weblogic. When I do upload a file to weblogic server directly without though webserver it's ok. I mean the uploaded file would be written to a specfied saving directory on server as soon as the upload process gets start. But with going through webserver, it does not happen immediately. After a long time passed the uploaded file begins to be written to the saving directory. The 'webserver' seems to buffer the amount as much as the file size, and then send them to weblogic. To sovle this problem I tried to change the webserver configuration(magnus.conf) as like,
    ChunkedRequestBufferSize 0, UseOutputStreamSize
    But doesn't work.
    Is there somthing of I'm missing? Get me out of this struggling.

    Thanks for your comments.
    What I'm doing is that first I made a simple upload jsp file using 'com.oreilly.servlet.MultipartRequest', and then try to upload with a html page over IE browser.
    That is,
    IE browser ( Local PC ) ---> Sun One Web Server ( Remote machine ) ---> Weblogic ( Local PC ).
    And I also peeked into the transferred data between webserver and weblogic. What I've found is that all data in the upload file would be buffered into webserver and then flushed out to weblogic at one time. I want to upload the file to weblogic server without buffering in webserver. Rather than a bug of webserver, I thinik I missed some configuration stuff of webserver, or weblogic.
    Local PC: Windows XP
    IE: 6.0
    Web Server: Sun One Web Server 6.1 SP9
    Weblogic: 10.3.0.0
    upload filesize: 4MB

  • Deletion of the file uploaded through Tcode - PRCC

    Hi,
    There is  a  ABC.CCD file provided by the credit card company that have being uiploaded through Tcode PRCC upon which the expenses that are being expended by the traveller are then claimed from reporting the expenses.
    A CCd file have being wrongly uploaded in the stsre through Tcode PRCC. we need to reverse the same.
    can any one please tell me the procedure for the same.
    Thanks in Advance
    Manish

    Afternoon!
    I had successfully done the same work . Besides Japanese filename, Korean and Chinese filenames are running ok.
    you should check following points:
    1. jsp's content-type:
    <META http-equiv=Content-Type content="text/html;charset=shift_jis">
    2. form's type:
    <form method="POST" name="aaaa" enctype="multipart/form-data" action = "MyServlet">
    if both points are right, perhaps you should download a new release of uploading file from http://www.servlets.com

  • Using tie-classed to change name of file uploaded through FTP protocol srvr

    Hi,
    I'm trying to use the extendedPreAddItem (or Post) method in an S_TieFolder class to automatically change the name of a file (an S_PublicObject) when it enters a Folder (via an FTP put upload).
    I'm fiddling around with code like this:
    AttributeValue val = AttributeValue.newAttributeValue(newDocName);
    val.setName(Document.NAME_ATTRIBUTE);
    rightpo.setAttribute(val);
    But it does not work: in the FTP client the filename is indeed changed, but somewhere at lower levels the original filename is still being used...
    Any helpfull ideas would be appreciated.
    TOon

    I'm aware of this... My ftp-client (FTP-Voyager) will prompt me if I "put" a file that already exists in the remote folder, and ask me to go ahead and replace the file, or cancel the put-operation.
    However in this case the ftp-client sees file X' remotely and I'm putting file X, so it does not prompt me at all...
    Stopping and restarting the FTP-client (in case it caches remote folder-contents...) does not change the behaviour.
    Timewise this is what happens:
    1) I put file X.
    2) My S_TieFolder class (extendedPreAddItem) changes it's name into X'.
    3) The ftp-put successfully completes
    4) I refresh the remote folder contents and see the X' name instead of the original X name.
    5) I re-put X (and would now like to have it changed into file X'').
    6) Before my S_TieFolder code executes, something (I'm still suspecting the cm-sdk) deletes the X' file first... ==> the logfile does not show any communication with the ftp-client here now.
    7) Then my S_TieFolder code executes and changes the name into X''.
    8) I refresh the remote folder contents: File X' disappears, file X (just re-put) changes into X''.
    More testing has shown that I'm also not able to delete these files (whose names have been changed by S_TieFolder): 'file does not exist' error.
    I need to know:
    a) If changing the files name on-the-fly using S_Tie class is supported at all.
    and
    b) if so, what am I doing wrong?
    Thanks
    Toon

  • Error while using File Upload through Frontend

    Hi,
    I need to upload an EXcel file , read the content and save the data to a db table. I used the
    <htmlb:fileUpload id = "FileUpload"
                                onUpload    = "HandleUpload"
                                upload_text = "Upload"
                         size        = "40"  />
    But while calling the function for clipboard
    CALL FUNCTION 'CLPB_IMPORT'
        TABLES
          data_tab   = excel_tab
        EXCEPTIONS
          clpb_error = 1
          OTHERS     = 2.
      IF sy-subrc <> 0.
        MESSAGE a037(alsmex).
      ENDIF.
    It is throwing the 'message a alsmex 037 cannot be processed in plugin mode https'. Can you pleas guide me how to rectify this problem. Is there a note for this?
    Regards,
    Shiny

    Hi Shiny,
    Did you ever come across a solution to this problem? I'm having the same issue myself.
    I have a function module that transfers the data from an excel file into database tables and when I try to call the FM from a BSP page I get the same error
    Message A ALSMEX 037 cannot be processed in plugin mode HTTP
    Just wondering if you ever solved this or found another way of uploading excel using BSP?
    Thanks,
    Darren

  • File uploading through the hidden form

    is there any way to upload a file like this...
    <input type="hidden" name="filename" value="C:/Temp/test.txt">

    It's in the com.orielly.servlets package. Take a look at the MultiPartRequest and MultiPartParser:
    http://www.servlets.com/cos/index.html
    There's also a FileUpload utility that's part of the Jakarta project:
    http://jakarta.apache.org/commons/fileupload/index.html
    . . .but, I don't think that was the original question. I think the question relates to this one:
    http://forum.java.sun.com/thread.jsp?forum=33&thread=356116&tstart=0&trange=30

  • Struts file upload without interMedia under ADF

    Can this be done ?
    I have an existing table with the following columns:
    Content BLOB
    MimeType VARCHAR2
    FileName VARCHAR2
    and more

    Very frustrated :(
    Trying to find an answer to my question above.
    If I Add a transient OrdDocDomain to the Entity/View Layer.
    Map this into the UIModel (drag-drop onto JSP as struts file upload) so a FormFile object is available in the struts Action layer.
    Override 'processUpdateModel' so I can obtain a reference to the FormFile object.
    In the commit event of the Action class, take the referenced FormFile and set the BLOB like follows;
    newRow.setAttribute("FileData",
    new BlobDomain(uploadFile.getFileData())
    Then call into the internal commit operation.
    The following exception is raised;
    04/11/19 07:32:18 java.lang.ArrayIndexOutOfBoundsException: 0
    04/11/19 07:32:18      at oracle.jbo.client.remote.OrdClientPostListener.notifyClientPostAfter(OrdClientUtil.java:135)
    04/11/19 07:32:18      at oracle.jbo.client.remote.ApplicationModuleImpl.postChanges(ApplicationModuleImpl.java:796)
    The transient OrdDocDomain has registered a listener.
    How can I remove this listener. The transient has a method 'removeListenerFromTransaction()' with the comment 'Internal: Applications should not use this method.' and no other references ?
    Does anyone know how the listener can be removed or better still, not be registered with the transaction.

  • Excel file upload in background

    Hi
    any one inform me how to Excel file will be Executed as a background job.
    The Excel file will be executed as a background job.
    This will eliminate issues related to network speed,
    time-outs,user logging off,ect;
    and the need for the user to remain logged in to the transaction till it finishes
    execution. After the background job completes the output report will be sent to the
    user via email as an attachment.
    Regards
    Gopal
    Duplicate thread.
    Edited by: kishan P on Aug 24, 2010 10:39 AM

    hi,
    function module for email attachment  -
    function module SO_DOCUMENT_SEND_API1
    function module for background schedule - u2018ALSM_EXCEL_TO_INTERNAL_TABLEu2019
    When scheduling a job in the background the appropriate statement to read in your file is OPEN DATASET, and the file must be on the file system that the SAP server can see.
    At anytime, a user can switch of the Personal Computers even though the job is still running in the background.  Therefore GUI_* and WS_* function modules are not designed to work in that way, as they need to access your personal computer  file.
    To choose the correct download method to used, you can check the value of SY-BATCH in your code,
    if it is 'X' use OPEN DATASET and if it is ' ' use WS_UPLOAD.
    link for help -
    Re: Excel file upload through BAPI in BACKGROUND
    Rgds
    Raj

  • Create a flat-file upload for a BO XAI Inbound Service?

    Hello all,
    If we don't have a schema defined for a BO XAI Inbound Service, how can we create the XSL and the flat-file upload schema file for it.
    Any advice?
    Regards,
    Kerr

    I don't have problem to create the XSLT mapping.
    But because it is to create a flat-file upload for a Business Object XAI Inbound Service, it doesn't have a schema on the server as to the thread Create Schema for Business Object to use for XAI Inbound Service?
    And I can't create that flat-file upload without a schema on the server.
    Or I can use the BO XAI Inbound Service WSDL instead to create the mapping for the flat-file upload.
    Regards,
    Kerr

  • When  submit remote object call getting error Client.Error.DeliveryInDoubt

    Hello,
    We are having very weird error DeliveryInDoubt from blazeds.
    [ERROR] failed to call the remote service !!![FaultEvent fault=[RPC Fault faultString="Channel disconnected" faultCode="Client.Error.DeliveryInDoubt" faultDetail="Channel disconnected before an acknowledgement was received"] messageId="98F7B030-0FE0-0B88-300C-EC422D055E21" type="fault" bubbles=false cancelable=true eventPhase=2
    Error does not happen every time, but rather from time to time but happens on all client machines.
    Environment:
    blazeds v3.
    Flex application with Remote Object.
    Browser IE7.
    Object that passed to blazeds is complex and might have 100 items.But number of items does not seem affect error occurences.
    Short description for the object passed to blazeds remote object call for processing:
    Remote Object call takes an argument ArrayCollection of SyncRequest objects (_requestSyncList)
                    var syncRequest:SyncRequest = new SyncRequest();
                    var syncObject:Object = new Object();
                    syncObject[requestBuilder.direction] = requestBuilder.jobMap;
                    syncRequest.syncJobs = syncObject;
                    _requestSyncList.addItem(syncRequest);          
    requestBuilder.jobMap is an object that have different artifacts.
    jobMap[obj.artifact] = myColl;
    myColl is ArrayCollection of artifact of SyncJob
    Here is the definition of SyncJob
       public class SyncJob
            public var jobName:String;
            [ArrayElementType("com.farmers.docprocessing.remotesync.vo.JobParameter")]
            public var jobParams:ArrayCollection;
    Not sure what causing that issue and how to debug it. 
    Please advice.
    Thank you

    Not without you psoting some code.
    Possible problem: Difference between object type being returned, vs the type of the reference (i.e., the method that returns an object should have a return type of the interface name).

  • Tomcat shutdowing when remote object is calling secondtime from flex to blazeds

    Hi All,
    I am new to flex and started working on that.now i called one remote object from flex through blazeds.its working fine but when i call second time tomcat is  shutdowing .again if i start tomcat it is working fine.
    what is the problem does any one helps?
    sudheer

    Thanks for the tip Joe.
    It's not quite what I was looking for, but it gave me some ideas.
    The blog post describes how to create your own server to handle the file stream. With BlazeDS & Java EE app server there's no need to implement the low level stuff.
    One option would be to read the data on Flex side in chunks and make a request to send each chunk at a time, but I don't know whether this helps at all. Might just slow down the network.
    Another option is to write a custom adapter for BlazeDS endpoint, but I don't know enough details on this to say is it possible or not.
    Third option is to use regular servlet code and Apache Commons FileUpload module.
    Still interested hearing opinions from people working with BlazeDS.

  • File Upload Error : Object could not be found in cache, key is null!

    I am having this problem. when I attach a file and press submit button, it gave me
    "Object could not be found in cache, key is null !"
    In my ViewController context I have Invoice_DOC attribute (binary, fileupload)
    and that is mapped to ComponentContoller.attribute(INVOICE_DOC).
    here is wdDoInit() method of my view controller..
    public void wdDoInit()
        IWDAttributeInfo attInfo =
              wdThis.wdGetDemurrageCompController().wdGetContext ().nodeSubmitElements().getNodeInfo().getAttribute(IPrivateDemurrageComp.ISubmitElementsElement.INVOICE_DOC);
    IWDModifiableBinaryType binaryType = (IWDModifiableBinaryType) attInfo.getModifiableSimpleType();
    Any Idea why I am having this..
    I went through some tutorials, The controller node has cardinality of 1..1...

    Hi,
    Could you please try with the following code. Here I have an Action for file uploading.
    public void wdDoInit()
    //@@begin wdDoInit()
    // get attribute info for context attribute "FileResource"
    IWDAttributeInfo attributeInfo =
    wdContext.getNodeInfo().getAttribute(
    IPrivateFileUploadView.IContextElement.FILE_RESOURCE);
    // make the context attribute's simple type modifiable.
    // Only with this line of code the binary data (stored within the
    // context attribute) can be parsed. The Web Dynpro Runtime stores
    // the mime-object’s metadata within the attribute’s type metadata.
    attributeInfo.getModifiableSimpleType();
    // set the file details invisible
    wdContext.currentContextElement().setDetailsVisibility(
    WDVisibility.NONE);
    //@@end
    //Another method for File upload button
    public void onActionUploadFile(
    com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent) {
    //@@begin onActionUploadFile(ServerEvent)
    // get attribute info for context attribute 'FileResource'
    IWDAttributeInfo attributeInfo =
    wdContext.getNodeInfo().getAttribute(
    IPrivateFileUploadView.IContextElement.FILE_RESOURCE);
    // get modifiable binary type from the attribute info,
    // requires type cast.
    IWDModifiableBinaryType binaryType =
    (IWDModifiableBinaryType) attributeInfo.getModifiableSimpleType();
    IPrivateFileUploadView.IContextElement element =
    wdContext.currentContextElement();
    // if a file in the 'FileResource' attribute exists
    if (element.getFileResource() != null) {
    try {
    String mimeType = binaryType.getMimeType().toString();
    byte[] file = element.getFileResource();
    // get the size of the uploaded file
    element.setFileSize(this.getFileSize(file));
    // get the extension of the uploaded file
    element.setFileExtension(
    binaryType.getMimeType().getFileExtension());
    // NOTE: context attribute 'FileName' must not be set
    // because the FileUpload-UI-element property 'fileName'
    // is bound to it. Consequently the fileName is automatically
    // written to the context after file upload.
    // set the details visibility attribute
    element.setDetailsVisibility(WDVisibility.VISIBLE);
    // report success message
    wdComponentAPI.getMessageManager().reportMessage(
    IMessageFileUpDownloadComp.SF_UPLOAD,
    new Object[] { binaryType.getFileName()},
    false);
    } catch (Exception e) {
    throw new WDRuntimeException(e);
    // if no file in the 'FileResource' attribute exists
    else {
    // set the details visibility attribute, hide details
    element.setDetailsVisibility(WDVisibility.NONE);
    // report error message
    IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
    msgMgr.reportContextAttributeMessage(
    element,
    attributeInfo,
    IMessageFileUpDownloadComp.NO_FILE,
    new Object[] { "" },
    true);
    // clear the FileResource context value attribute
    element.setFileResource(null);
    //@@end
    Thanks
    Chandan

  • File upload and download through web Dynpro2.0.9.

    Hai All,
          File upload and download through web Dynpro "IWDResource" package is used.But in web Dynpro 2.0.9. this package is not possible.How to uplolad and download  files through web Dynpro2.0.9.
          Anyone can help me?
    Thanks in Advance,
    Kindly Regards,
    K.Saravanan.

    Hi Saravanan,
    You can go through these links,
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/63/9c0e41a346ef6fe10000000a1550b0/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/63/9c0e41a346ef6fe10000000a1550b0/frameset.htm</a>
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/5a/90ff4cd0c8cd48a69b836e5e550880/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/5a/90ff4cd0c8cd48a69b836e5e550880/frameset.htm</a>
    So, apart from putting FileUpload UI on your view, you have to implement a method which will do the actual uplod for you.
    Hope this helps.
    Regards,
    Mausam

Maybe you are looking for

  • The Distribution Kit Builder is Looking for the NI Variable Engine in an old distribution, cant find it and fails to build

     I am unable to build a distribution kit because the builder appears to have saved a path to the NI Variable Engine which is not valid.  I appear to have the NI Variable Engine installed.   There are NI Variable Engine 2.5.0 .xml files loaded in on m

  • Problem with creation message

    Hello. we have configured our Solution Manager for VAR. We added the Support Team to patrner schema (SLFC0001) also we added support team to rule 13200137 CRM_DNO_1. After that when we try to create message with BC* component the window "Create Suppo

  • How to run something on shutdown before file systems unmounted

    I've been trying to get kexec working with systemd, following the advice on this wiki page: https://wiki.archlinux.org/index.php/Kexec#Systemd Unfortunately, the suggested unit file does not work for me.  The problem is that no matter what I do, my /

  • Error when compiling OSMF 2

    I downloaded the latest OSMF and for some reason they decided not to include a osmf.swc file.  After some work I finally got to the point where I have almost created my own from the source.  Unfortunatley I am still having one problem. When I try to

  • WRT54G Wireless Router - Reset SSID by itself.

    WRT54GSV4 Unexpectedly, the SSID went from one that I had set and reverted back to "Linksys." I don't know why. Is there a way to find out why it happened?