Menu

Integrate JUpload in PHP

bhavya mr
2011-01-21
2012-09-21
  • bhavya mr

    bhavya mr - 2011-01-21

    Hi ,
    How do i integrate JUpload in php. I am verynew to this. I have referred lots
    of links but i did not understand this.

    Can anyone pl explain the steps and the code ?

    Its urgent

    Thanks in Advance

     
  • Geoff

    Geoff - 2011-01-21

    Please see the sample PHP code included in the package.

     
  • bhavya mr

    bhavya mr - 2011-01-21

    hi i have seen the PHP code included in the package.i.e., samples.PHP. But if
    i run the index.php its giving the below errors. Java is installed in my
    system what might be the problem?

    Java Plug-in 1.6.0_23
    Using JRE version 1.6.0_23-b05 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\sbxuser


    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>


    load: class com.thinfile.upload.ThinSliceDemo not found.
    java.lang.ClassNotFoundException: com.thinfile.upload.ThinSliceDemo
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown
    Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed:http://localhost/
    bhavya/ThinSliceDemo-1.05/com/thinfile/upload/ThinSliceDemo.class

    at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
    at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
    at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    ... 9 more

     
  • Etienne

    Etienne - 2011-01-22

    That's really strange.

    com.thinfile.upload.ThinSliceDemo is totally out of topic. I guess you're
    mixing two different projects here.

    Or perhaps you changed the jupload PHP sample code a little bit, and it
    doesn't work now ?

    Etienne

     
  • bhavya mr

    bhavya mr - 2011-01-24

    Hi ,

    Thanks for your reply again i downloaded the code. This time its showing

    00000 09:05:39.796 wjhk.jupload2.gui.JUploadTextArea$LogMessageThread Logging
    system is initialized00001 09:05:39.765 wjhk.jupload2.JUploadApplet JUpload
    juploadContext started, with wjhk.jupload2.policies.DefaultUploadPolicy upload
    policy
    00002 09:05:39.765 wjhk.jupload2.JUploadApplet Debug level set to 99
    00003 09:05:39.765 wjhk.jupload2.JUploadApplet Current debug output file:
    C:\DOCUME~1\sbxuser\LOCALS~1\Temp\jupload_6278768521836716539_log.txt
    00004 09:05:39.765 wjhk.jupload2.JUploadApplet lang = null, taking default
    language
    00005 09:05:39.781 wjhk.jupload2.JUploadApplet end of constructor
    (serverProtocol has been set)
    00006 09:05:39.781 wjhk.jupload2.JUploadApplet uploadPolicy parameter =
    DefaultUploadPolicy
    00007 09:05:39.781 wjhk.jupload2.JUploadApplet uploadPolicy =
    wjhk.jupload2.policies.DefaultUploadPolicy
    00008 09:05:39.781 wjhk.jupload2.JUploadApplet
    =======================================================================
    00009 09:05:39.781 wjhk.jupload2.JUploadApplet ======= Parameters managed by
    DefaultUploadPolicy
    00010 09:05:39.781 wjhk.jupload2.JUploadApplet JUpload applet, version 5.0.1 -
    Dec 24, 2010 (compiled: Dec 24, 2010), available at
    http://jupload.sourceforge.net/
    00012 09:05:39.781 HttpProtocolFinderThread Getting serverProtocol from HEAD
    request
    00011 09:05:39.781 wjhk.jupload2.JUploadApplet Java version: 1.6.0_23
    00013 09:05:39.796 wjhk.jupload2.JUploadApplet List of all applet parameters:
    00014 09:05:39.796 wjhk.jupload2.JUploadApplet language: en
    00015 09:05:39.796 wjhk.jupload2.JUploadApplet country:
    00016 09:05:39.796 wjhk.jupload2.JUploadApplet afterUploadURL: http://localho
    st/bhavya/sam/site/samples.php/after_upload.php

    00017 09:05:39.796 wjhk.jupload2.JUploadApplet allowHttpPersistent: false
    00018 09:05:39.796 HttpProtocolFinderThread Checking protocol with URL: http:
    //localhost/bhavya/sam/site/samples.php/

    00019 09:05:39.796 wjhk.jupload2.JUploadApplet allowedFileExtensions: null
    00020 09:05:39.796 wjhk.jupload2.JUploadApplet browsingDirectory (current
    value): null
    00022 09:05:39.796 wjhk.jupload2.JUploadApplet debugLevel: 99
    00021 09:05:39.796 HttpProtocolFinderThread proxy=DIRECT, proxy.type=DIRECT,
    useProxy=false, url.host=localhost, url.port=-1
    00023 09:05:39.796 wjhk.jupload2.JUploadApplet (debugfile:
    C:\DOCUME~1\sbxuser\LOCALS~1\Temp\jupload_6278768521836716539_log.txt)
    00024 09:05:39.796 wjhk.jupload2.JUploadApplet fileChooserIconFromFileContent:
    0
    00025 09:05:39.796 HttpProtocolFinderThread Start
    00027 09:05:39.796 HttpProtocolFinderThread End
    00026 09:05:39.796 wjhk.jupload2.JUploadApplet fileChooserIconSize: 20
    00028 09:05:39.796 HttpProtocolFinderThread
    00029 09:05:39.796 wjhk.jupload2.JUploadApplet fileFilterName: null
    00030 09:05:39.796 HttpProtocolFinderThread Before sendRequest()
    00031 09:05:39.796 wjhk.jupload2.JUploadApplet filenameEncoding: null
    00033 09:05:39.796 wjhk.jupload2.JUploadApplet formdata: null
    00034 09:05:39.796 wjhk.jupload2.JUploadApplet ftpCreateDirectoryStructure:
    false
    00035 09:05:39.796 wjhk.jupload2.JUploadApplet ftpTransfertBinary: true
    00036 09:05:39.796 wjhk.jupload2.JUploadApplet ftpTransfertPassive: true
    00037 09:05:39.796 wjhk.jupload2.JUploadApplet httpUploadParameterName: File
    00038 09:05:39.796 wjhk.jupload2.JUploadApplet httpUploadParameterType: array
    00039 09:05:39.796 wjhk.jupload2.JUploadApplet lang: null
    00040 09:05:39.796 wjhk.jupload2.JUploadApplet maxChunkSize: 500000
    00041 09:05:39.796 wjhk.jupload2.JUploadApplet maxFileSize: 2147483648
    00042 09:05:39.796 wjhk.jupload2.JUploadApplet nbFilesPerRequest: 1
    00043 09:05:39.796 wjhk.jupload2.JUploadApplet postURL: http://localhost/bhav
    ya/sam/site/samples.php/

    00044 09:05:39.796 wjhk.jupload2.JUploadApplet readCookieFromNavigator: true
    00045 09:05:39.796 wjhk.jupload2.JUploadApplet readUserAgentFromNavigator:
    true
    00046 09:05:39.796 wjhk.jupload2.JUploadApplet retryMaxNumberOf: 1
    00047 09:05:39.796 wjhk.jupload2.JUploadApplet retryNbSecondsBetween: 30
    00048 09:05:39.796 wjhk.jupload2.JUploadApplet sendMD5Sum: true
    00049 09:05:39.796 wjhk.jupload2.JUploadApplet serverProtocol: HTTP/1.1
    00050 09:05:39.796 wjhk.jupload2.JUploadApplet showLogWindow: true
    00051 09:05:39.796 wjhk.jupload2.JUploadApplet showStatusbar: true
    00052 09:05:39.796 wjhk.jupload2.JUploadApplet specificHeaders: null
    00053 09:05:39.796 wjhk.jupload2.JUploadApplet Headers that will be added to
    the POST request:
    00054 09:05:39.796 wjhk.jupload2.JUploadApplet stringUploadError: ERROR: (.)
    00055 09:05:39.796 wjhk.jupload2.JUploadApplet stringUploadSuccess: SUCCESS
    00056 09:05:39.796 wjhk.jupload2.JUploadApplet stringUploadWarning: ^WARNING:
    (.
    )$
    00057 09:05:39.796 wjhk.jupload2.JUploadApplet urlToSendErrorTo: null
    00058 09:05:39.796 wjhk.jupload2.JUploadApplet
    00059 09:05:39.796 wjhk.jupload2.JUploadApplet After
    UploadPolicyFactory.getUploadPolicy(this)
    00060 09:05:39.796 wjhk.jupload2.JUploadApplet Before
    this.logWindow.setUploadPolicy(this.uploadPolicy)
    00061 09:05:39.796 wjhk.jupload2.JUploadApplet Before new
    JUploadPanelImpl(this.logWindow,this.uploadPolicy)
    00032 09:05:39.812 HttpProtocolFinderThread Using non SSL socket, direct
    connection
    00062 09:05:39.828 HttpProtocolFinderThread After sendRequest()
    00063 09:05:39.828 HttpProtocolFinderThread


    00064 09:05:39.828 HttpProtocolFinderThread ----------------- HEAD message
    sent (start) --------------------------
    00065 09:05:39.828 HttpProtocolFinderThread


    00066 09:05:39.828 HttpProtocolFinderThread HEAD /bhavya/sam/site/samples.php/
    HTTP/1.1
    00066 09:05:39.828 HttpProtocolFinderThread Host: localhost
    00066 09:05:39.828 HttpProtocolFinderThread Accept: /
    00066 09:05:39.828 HttpProtocolFinderThread Accept-Encoding: identity
    00066 09:05:39.828 HttpProtocolFinderThread Connection: close
    00066 09:05:39.828 HttpProtocolFinderThread
    00067 09:05:39.828 HttpProtocolFinderThread


    00068 09:05:39.828 HttpProtocolFinderThread ----------------- HEAD message
    sent (end) -----------------------------
    00069 09:05:39.828 HttpProtocolFinderThread


    00070 09:05:39.828 HttpProtocolFinderThread -------- Response Headers Start

    00071 09:05:39.828 wjhk.jupload2.JUploadApplet Before
    rootPaneContainer.setContentPane(this.jUploadPanel);
    00072 09:05:39.828 HttpProtocolFinderThread HTTP/1.1 200 OK
    00073 09:05:39.828 HttpProtocolFinderThread Date: Mon, 24 Jan 2011 03:35:39
    GMT
    00074 09:05:39.843 HttpProtocolFinderThread Server: Apache/2.2.14 (Win32)
    DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1
    mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1
    00075 09:05:39.843 wjhk.jupload2.JUploadApplet Before new
    JavascriptHandler(this.uploadPolicy, this.jUploadPanel)
    00076 09:05:39.843 HttpProtocolFinderThread X-Powered-By: PHP/5.3.1
    00077 09:05:39.843 HttpProtocolFinderThread Set-Cookie:
    PHPSESSID=nli94dpp84ooca7kin8jttsc10; path=/
    00078 09:05:39.843 HttpProtocolFinderThread Calling
    this.cookies.parseCookieHeader, with parameter:
    PHPSESSID=nli94dpp84ooca7kin8jttsc10; path=/
    00079 09:05:39.843 HttpProtocolFinderThread Cookie header parsed.
    00080 09:05:39.843 HttpProtocolFinderThread Expires: Thu, 19 Nov 1981 08:52:00
    GMT
    00081 09:05:39.843 HttpProtocolFinderThread Cache-Control: no-store, no-cache,
    must-revalidate, post-check=0, pre-check=0
    00082 09:05:39.843 HttpProtocolFinderThread Pragma: no-cache
    00083 09:05:39.843 HttpProtocolFinderThread Connection: close
    00084 09:05:39.843 HttpProtocolFinderThread Content-Type: text/html
    00085 09:05:39.843 HttpProtocolFinderThread
    00086 09:05:39.843 HttpProtocolFinderThread --------- Response Headers End


    00087 09:05:39.843 HttpProtocolFinderThread This is a HEAD request: we don't
    care about the bytearrayResponseBody
    00088 09:05:39.843 HttpProtocolFinderThread HEAD status: 200
    00089 09:05:39.843 HttpProtocolFinderThread HEAD protocol: HTTP/1.1
    00090 09:05:39.843 wjhk.jupload2.JUploadApplet Before new Properties();
    00091 09:05:39.843 wjhk.jupload2.JUploadApplet Mime types list loaded Ok
    (/conf/mimetypes.properties)
    00092 09:05:39.843 wjhk.jupload2.JUploadApplet End of
    DefaultJUploadContext.init()
    00093 09:05:39.859 thread applet-wjhk.jupload2.JUploadApplet-4 JUploadApplet
    is now initialized.
    00094 09:05:39.859 thread applet-wjhk.jupload2.JUploadApplet-4 JUploadApplet
    is now started.

    And sorry i have pasted very long error messages here.
    And we have 3 files(index.php, jupload.php and after_upload.php) in
    samples.php folder. And i have not chnaged anything in index file. Just i am
    executing the file. http://localhost/bhavya/sam/site/samples.php/
    Its giving the above error..and In index.php they have mentioned about how to
    change/set this code. And this is link to refer some sample settings
    http://jupload.sourceforge.net/howto-
    customization.html..

    I did not understand..Pl let me know what should i change? If i upload some
    file it should save in a folder.. (Like how we will do normal file
    uploading)..This is very urgent.I am thankful to you if you can send me..
    This is my email ID-> bhavya.gowda@gmail.com

    Pl send the me sample code with changes..(If its possible)

    Thanks much

     
  • bhavya mr

    bhavya mr - 2011-01-24

    Pl Note: I am uploading videos...

     
  • Etienne

    Etienne - 2011-01-24

    Hi,

    From the debug output, the applet runs correctly. And the error pasted in the
    third message, here above, is out of topic.

    So, now, you should be able to customize the PHP demo, according to your
    needs. Please read the http://jupload.sourceforge.net/howto-
    customization.html

    page, and update the index.php file of the PHP sample, according to the
    JUpload customization capabilities.

    Etienne

     
  • Geoff

    Geoff - 2011-01-24

    In other words, your problem is not in jupload, but in "Thin Slice Upload" - I
    suggest you take it up with the developers of that product, not jupload!

     

Log in to post a comment.