1. #1
    Sencha User commanche's Avatar
    Join Date
    Jun 2008
    Location
    Prague, Czech Republic
    Posts
    20
    Vote Rating
    3
    commanche is on a distinguished road

      3  

    Default File upload widget - using File API and Ext.data.Connection

    File upload widget - using File API and Ext.data.Connection


    File upload widget for Ext JS v4.x

    Current version: v1.1.1 (2013-11-05) - README, CHANGELOG

    Main features:
    • flexible and easily integratable
    • uses the native File API (HTML5)
    • allows selecting and uploading of multiple files at once
    • supports both raw PUT/POST upload and multipart upload
    • you can easily write and integrate your own upload mechanism, while preserving all (or most) of the UI functionality
    • displays upload progress
    • supports asynchronous (simultaneous) upload
    Links: extjs-upload-widget.jpg

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,111
    Vote Rating
    470
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    We have numerous requests for this type of widget. Thanks for sharing.

    Regards,
    Scott.

  3. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    19
    Vote Rating
    0
    kappiil is on a distinguished road

      0  

    Default


    Hi, we have been trying to use this widget in our code. We have been successful in rendering the UI and ExtJS part. BUT when we upload files we are getting exception in our Java code (Spring Action Class). Could you please help us how can we do the upload functionality in java instead of php??

    Thanks in advance.

    Thanks
    Kapil

  4. #4
    Sencha User commanche's Avatar
    Join Date
    Jun 2008
    Location
    Prague, Czech Republic
    Posts
    20
    Vote Rating
    3
    commanche is on a distinguished road

      0  

    Default


    Quote Originally Posted by kappiil View Post
    Hi, we have been trying to use this widget in our code. We have been successful in rendering the UI and ExtJS part. BUT when we upload files we are getting exception in our Java code (Spring Action Class). Could you please help us how can we do the upload functionality in java instead of php??

    Thanks in advance.

    Thanks
    Kapil
    What kind of exception did you get?

    When implementing the server part, you have to process raw POST data. It's not a standard file upload. In PHP it's easy - you have to read the standard input. But I don't know how that can be done in Java.

  5. #5
    Sencha User
    Join Date
    Feb 2012
    Posts
    19
    Vote Rating
    0
    kappiil is on a distinguished road

      0  

    Default


    HI,
    We are getting this Exception in console. So please help me.

    SEVERE: Servlet.service() for servlet [appServlet] in context with path [/Login] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause
    java.lang.NullPointerException
    at com.mpm.common.controller.FileUploadController.create(FileUploadController.java:55)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
    at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:436)
    at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:424)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:669)
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:585)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:279)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)


    Thanks
    Kapil

  6. #6
    Sencha User commanche's Avatar
    Join Date
    Jun 2008
    Location
    Prague, Czech Republic
    Posts
    20
    Vote Rating
    3
    commanche is on a distinguished road

      0  

    Default


    I'm sorry, but I can't help you. I'm not a Java programmer. I would advice you to search for solution for retrieving raw post data, for example:

    http://stackoverflow.com/questions/5...equest-in-java

  7. #7
    Sencha User
    Join Date
    Apr 2012
    Posts
    38
    Vote Rating
    -5
    mayur_satasiya can only hope to improve

      0  

    Default


    HiCommanche,
    I can Upload multiple file at a time using File Upload widget. but can u help me for finding the file path, How can i get the full file path instead of only file name in Http- Request, Please help me this out.


    Thanks
    Mayur

  8. #8
    Sencha User commanche's Avatar
    Join Date
    Jun 2008
    Location
    Prague, Czech Republic
    Posts
    20
    Vote Rating
    3
    commanche is on a distinguished road

      0  

    Default


    Quote Originally Posted by mayur_satasiya View Post
    HiCommanche,
    I can Upload multiple file at a time using File Upload widget. but can u help me for finding the file path, How can i get the full file path instead of only file name in Http- Request, Please help me this out.

    Thanks
    Mayur
    Hi,
    I'm not sure that I understand your question. Are you talking about the example and the upload.php script? If that is the case, the upload.php script doesn't save the data into files, it just reads them. To save the file, you need to do something like:
    PHP Code:
    $fp fopen('php://input''r');
    $targetFile fopen('/some/directory/' $fileName'w');

    while (!
    feof($fp)) {
        
    $data fread($fp1024);
        
    fwrite($targetFile$data);

    Maybe I should add some more examples...

  9. #9
    Sencha User
    Join Date
    Apr 2012
    Posts
    38
    Vote Rating
    -5
    mayur_satasiya can only hope to improve

      0  

    Default


    Thanks for your reply,
    but i want full path of file from where the original file pickup.from any location of local system.
    when we press Browse button and pickup file i want that original file path. and Http Request only gives me file name not the full path. so i want full file path.



    Thanks
    Mayur

  10. #10
    Sencha User commanche's Avatar
    Join Date
    Jun 2008
    Location
    Prague, Czech Republic
    Posts
    20
    Vote Rating
    3
    commanche is on a distinguished road

      0  

    Default


    Quote Originally Posted by mayur_satasiya View Post
    Thanks for your reply,
    but i want full path of file from where the original file pickup.from any location of local system.
    when we press Browse button and pickup file i want that original file path. and Http Request only gives me file name not the full path. so i want full file path.

    Thanks
    Mayur
    Ok, you mean the full path of the file on the client side...
    That information is not available through the File API:

    http://www.w3.org/TR/FileAPI/#dfn-file

    Probably for security reasons...