Page 1 of 3

process.php, process.jsp and mysql database

Posted: Wed Oct 21, 2009 5:51 am
by CortoMaltese
Hey guys
I thought i would open a topic for that particular subject

2 questions :

1. Is there a way to use process.jsp and adding the file name in a mysql database, knowing i only know php and all my site is in php .

2. in process.php I can't find the right place(s) to put my mysql insert query. I tried all I found on the forum, but none work
The only good result is when I launch directly process.php and using the form in it... But the same one via the applet, do not work !

Thank you very much

C.

Re: process.php, process.jsp and mysql database

Posted: Wed Oct 21, 2009 6:24 am
by support
1. Is there a way to use process.jsp and adding the file name in a mysql database, knowing i only know php and all my site is in php .
No, JSP requires Java and servlet engine (such as TOMCAT) on server-side. If you have TOMCAT then integrating MySQL won't be a problem.
2. in process.php I can't find the right place(s) to put my mysql insert query. I tried all I found on the forum, but none work
The only good result is when I launch directly process.php and using the form in it... But the same one via the applet, do not work !
I would add this after: $message = do_post_upload($target_folder,$max_size,$resume);
or inside do_post_upload

Re: process.php, process.jsp and mysql database

Posted: Wed Oct 21, 2009 8:01 am
by CortoMaltese
No, JSP requires Java and servlet engine (such as TOMCAT) on server-side. If you have TOMCAT then integrating MySQL won't be a problem.
But this will have to be coded in jsp right ?
I would add this after: $message = do_post_upload($target_folder,$max_size,$resume);
or inside do_post_upload
I try that...

Re: process.php, process.jsp and mysql database

Posted: Thu Oct 22, 2009 6:48 am
by support
But this will have to be coded in jsp right ?
You should create a JavaBean and just call a method such as myBean.store(filename);
The JavaBean is an external Java class based on JDBC API to access MySQL.

Re: process.php, process.jsp and mysql database

Posted: Fri Oct 23, 2009 12:24 am
by CortoMaltese
ok thanks

Re: process.php, process.jsp and mysql database

Posted: Fri Nov 06, 2009 1:20 pm
by kmvijay
Could anyone please describe how to get successfully uploaded file name to text box in the same web page, but without clicking any buttons?.

"JFileUpload/documentation/samples/javascript_api/applet_http.html" This page describes only after clicking the buttons. But I want without clicking any buttons?.

Re: process.php, process.jsp and mysql database

Posted: Fri Nov 06, 2009 10:55 pm
by support
You mean start upload automatically ? Without end-user action ?

Re: process.php, process.jsp and mysql database

Posted: Mon Nov 09, 2009 10:10 am
by kmvijay
No.

In a web page I have one Text Box i.e. (http://tinymce.moxiecode.com/) actually it is tinymce HTML editor.
Under the editor, I like to use your JFileUpload container.

When the user drag and drop the image single/multiple files, once it is successfully uploaded to the Server, then I have to show the exact Server URL LINK (e.g. <img src="https://server.com/files/2009/14507-image1.jpg" alt="14507-image1.jpg" /><br /> ) in the TinyMCE Editor.

Is it possible to show the URL Link in the HTML editor without clicking any buttons after user drag and dropped the images?.

Re: process.php, process.jsp and mysql database

Posted: Mon Nov 09, 2009 6:45 pm
by support
I think that you should use JSAPI add-on. Once upload is completed you can have a JavaScript callback so you could update your editor from JavaScript.
http://www.jfileupload.com/products/tools/index.html

Re: process.php, process.jsp and mysql database

Posted: Wed Nov 11, 2009 12:03 pm
by kmvijay
Hi,
Below is the error message after running html web page applet_http_jsapi.html in Internet Explorer. I haven't changed any configuration. Just tried to see the applet is is running in web page.

But if I run applet_http.html, it's running ok.

Java Plug-in 1.6.0_15
Using JRE version 1.6.0_15-b03 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\user1
----------------------------------------------------
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>
----------------------------------------------------


java.lang.NoClassDefFoundError: jfileupload/transfer/client/core/P
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.defineClassHelper(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.access$400(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.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.lang.ClassNotFoundException: jfileupload.transfer.client.core.P
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 20 more
Caused by: java.io.IOException: open HTTP connection failed:http://localhost/test/jfileupload/jfile ... re/P.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)
... 24 more
Exception: java.lang.NoClassDefFoundError: jfileupload/transfer/client/core/P