azlumiere
asked on
Problem with Javascript Containing a Relative Path--I need an Absolute Path
Dear Experts,
I have a challenge that I’m not sure I’ll be able to solve, but I thought if it was possible, someone here would know. Here’s my issue:
I purchased a really nice script that slices HTTP uploads into smaller manageable pieces. I use it for clients who need to share large files, but find FTP too cumbersome, and it also makes large file uploads possible on a shared server. This is the product: http://upload.thinfile.com/resume/
It works great, but only in a relative path environment. I now have a couple of Wordpress sites that I’d like to incorporate this script on (in conjunction with a password protected page) but as you can guess, since I don’t have full path names for pages the script doesn’t work. I really don’t want to force Wordpress to show the full path name for each link, so that isn’t an option (and I'm not sure that would work anyways).
I sent an email to the company and they’ve ignored me, which is why I thought I would reach out to EE.
The script is essentially made up of 5 files:
applet.php
slice.php
ThinSlice.jar
thinupload.properties
embed.js
I imagine the settings that control the relative path are in the .jar file, but I have no experience with this type of file. I unzipped all the files to tried and take a look, but there are 38 .class files and they look to be encrypted.
I guess my long-winded question is, does it sound like this is anything that I can control/change, or does it seem more like these settings are set in stone and I’m out of luck?
I originally thought the issue was with the applet or embed.js file which I’ve pasted below. But even when I change the relative paths to absolute paths it still doesn't work, which is why I’m guessing the REAL issue is in the .jar file.
-------------------------- -
I set up a testing site here:
Page with Absolute Path that works right:
http://www.dzinentertainment.com/wp-content/themes/default/client-manager.php
Identical page in Wordpress that doesn't work right:
http://dzinentertainment.com/client-manager/
Here is a zipped folder with the 7 files that it takes to work:
http://dzinentertainment.com/sliced-upload.zip
I used these identical files for both pages above.
While I was setting up this test, I did copy the error message that comes up on the Wordpress page (you can see it there). I've pasted it below.
I hope this gives more helpful information.
----------------------Erro r Message I Get----------------------- ------
Java Plug-in 1.6.0_20
Using JRE version 1.6.0_20-b02 Java HotSpot(TM) Client VM
User home directory = C:\Users\User
-------------------------- ---------- ---------- ------
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>
-------------------------- ---------- ---------- ------
--- Init applet: com.screencastomatic.detec t.DetectAp plet[panel 0,0,0,0x0, invalid,hi dden,layou t=java.awt .FlowLayou t]
--- Start applet: com.screencastomatic.detec t.DetectAp plet[panel 0,0,0,0x0, layout=jav a.awt.Flow Layout]
--- Init applet: com.screencastomatic.detec t.DetectAp plet[panel 1,0,0,0x0, invalid,hi dden,layou t=java.awt .FlowLayou t]
--- Start applet: com.screencastomatic.detec t.DetectAp plet[panel 1,0,0,0x0, layout=jav a.awt.Flow Layout]
--- Init applet: com.screencastomatic.detec t.DetectAp plet[panel 2,0,0,0x0, invalid,hi dden,layou t=java.awt .FlowLayou t]
--- Start applet: com.screencastomatic.detec t.DetectAp plet[panel 2,0,0,0x0, layout=jav a.awt.Flow Layout]
--- Init applet: com.screencastomatic.detec t.DetectAp plet[panel 3,0,0,0x0, invalid,hi dden,layou t=java.awt .FlowLayou t]
--- Start applet: com.screencastomatic.detec t.DetectAp plet[panel 3,0,0,0x0, layout=jav a.awt.Flow Layout]
--- Init applet: com.screencastomatic.detec t.DetectAp plet[panel 4,0,0,0x0, invalid,hi dden,layou t=java.awt .FlowLayou t]
--- Start applet: com.screencastomatic.detec t.DetectAp plet[panel 4,0,0,0x0, layout=jav a.awt.Flow Layout]
Thin Slice Upload. Demo Version 1.00.3
Thin File (Pvt) Ltd.
http://www.thinfile.com/
java.lang.NullPointerExcep tion
at j.init(Unknown Source)
at com.thinfile.upload.ThinSl iceDemo.in it(Unknown Source)
at sun.plugin2.applet.Plugin2 Manager$Ap pletExecut ionRunnabl e.run(Unkn own Source)
at java.lang.Thread.run(Unkno wn Source)
Exception: java.lang.NullPointerExcep tion
load: class com.thinfile.upload.ThinSl iceDemo not found.
java.lang.ClassNotFoundExc eption: com.thinfile.upload.ThinSl iceDemo
at sun.plugin2.applet.Applet2 ClassLoade r.findClas s(Unknown Source)
at java.lang.ClassLoader.load Class(Unkn own Source)
at java.lang.ClassLoader.load Class(Unkn own Source)
at sun.plugin2.applet.Plugin2 ClassLoade r.loadCode (Unknown Source)
at sun.plugin2.applet.Plugin2 Manager.cr eateApplet (Unknown Source)
at sun.plugin2.applet.Plugin2 Manager$Ap pletExecut ionRunnabl e.run(Unkn own Source)
at java.lang.Thread.run(Unkno wn Source)
Caused by: java.io.FileNotFoundExcept ion: C:\Users\User\Downloads\Th inSliceDem o\ThinSlic eDemo-1.05 \thin-slic e-demo\thi n-slice-de mo\com\thi nfile\uplo ad\ThinSli ceDemo.cla ss (The system cannot find the path specified)
at java.io.FileInputStream.op en(Native Method)
at java.io.FileInputStream.<i nit>(Unkno wn Source)
at java.io.FileInputStream.<i nit>(Unkno wn Source)
at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
at sun.plugin2.applet.Applet2 ClassLoade r.getBytes (Unknown Source)
at sun.plugin2.applet.Applet2 ClassLoade r.access$0 00(Unknown Source)
at sun.plugin2.applet.Applet2 ClassLoade r$1.run(Un known Source)
at java.security.AccessContro ller.doPri vileged(Na tive Method)
... 7 more
Exception: java.lang.ClassNotFoundExc eption: com.thinfile.upload.ThinSl iceDemo
--- Init applet: com.screencastomatic.detec t.DetectAp plet[panel 5,0,0,0x0, invalid,hi dden,layou t=java.awt .FlowLayou t]
--- Start applet: com.screencastomatic.detec t.DetectAp plet[panel 5,0,0,0x0, layout=jav a.awt.Flow Layout]
load: class com.thinfile.upload.ThinSl ice not found.
java.lang.ClassNotFoundExc eption: com.thinfile.upload.ThinSl ice
at sun.plugin2.applet.Applet2 ClassLoade r.findClas s(Unknown Source)
at java.lang.ClassLoader.load Class(Unkn own Source)
at java.lang.ClassLoader.load Class(Unkn own Source)
at sun.plugin2.applet.Plugin2 ClassLoade r.loadCode (Unknown Source)
at sun.plugin2.applet.Plugin2 Manager.cr eateApplet (Unknown Source)
at sun.plugin2.applet.Plugin2 Manager$Ap pletExecut ionRunnabl e.run(Unkn own Source)
at java.lang.Thread.run(Unkno wn Source)
Caused by: java.io.IOException: open HTTP connection failed:http://dzinentertainment.com/client-manager/com/thinfile/upload/ThinSlice.class
at sun.plugin2.applet.Applet2 ClassLoade r.getBytes (Unknown Source)
at sun.plugin2.applet.Applet2 ClassLoade r.access$0 00(Unknown Source)
at sun.plugin2.applet.Applet2 ClassLoade r$1.run(Un known Source)
at java.security.AccessContro ller.doPri vileged(Na tive Method)
... 7 more
Exception: java.lang.ClassNotFoundExc eption: com.thinfile.upload.ThinSl ice
I have a challenge that I’m not sure I’ll be able to solve, but I thought if it was possible, someone here would know. Here’s my issue:
I purchased a really nice script that slices HTTP uploads into smaller manageable pieces. I use it for clients who need to share large files, but find FTP too cumbersome, and it also makes large file uploads possible on a shared server. This is the product: http://upload.thinfile.com/resume/
It works great, but only in a relative path environment. I now have a couple of Wordpress sites that I’d like to incorporate this script on (in conjunction with a password protected page) but as you can guess, since I don’t have full path names for pages the script doesn’t work. I really don’t want to force Wordpress to show the full path name for each link, so that isn’t an option (and I'm not sure that would work anyways).
I sent an email to the company and they’ve ignored me, which is why I thought I would reach out to EE.
The script is essentially made up of 5 files:
applet.php
slice.php
ThinSlice.jar
thinupload.properties
embed.js
I imagine the settings that control the relative path are in the .jar file, but I have no experience with this type of file. I unzipped all the files to tried and take a look, but there are 38 .class files and they look to be encrypted.
I guess my long-winded question is, does it sound like this is anything that I can control/change, or does it seem more like these settings are set in stone and I’m out of luck?
I originally thought the issue was with the applet or embed.js file which I’ve pasted below. But even when I change the relative paths to absolute paths it still doesn't work, which is why I’m guessing the REAL issue is in the .jar file.
--------------------------
I set up a testing site here:
Page with Absolute Path that works right:
http://www.dzinentertainment.com/wp-content/themes/default/client-manager.php
Identical page in Wordpress that doesn't work right:
http://dzinentertainment.com/client-manager/
Here is a zipped folder with the 7 files that it takes to work:
http://dzinentertainment.com/sliced-upload.zip
I used these identical files for both pages above.
While I was setting up this test, I did copy the error message that comes up on the Wordpress page (you can see it there). I've pasted it below.
I hope this gives more helpful information.
----------------------Erro
Java Plug-in 1.6.0_20
Using JRE version 1.6.0_20-b02 Java HotSpot(TM) Client VM
User home directory = C:\Users\User
--------------------------
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>
--------------------------
--- Init applet: com.screencastomatic.detec
--- Start applet: com.screencastomatic.detec
--- Init applet: com.screencastomatic.detec
--- Start applet: com.screencastomatic.detec
--- Init applet: com.screencastomatic.detec
--- Start applet: com.screencastomatic.detec
--- Init applet: com.screencastomatic.detec
--- Start applet: com.screencastomatic.detec
--- Init applet: com.screencastomatic.detec
--- Start applet: com.screencastomatic.detec
Thin Slice Upload. Demo Version 1.00.3
Thin File (Pvt) Ltd.
http://www.thinfile.com/
java.lang.NullPointerExcep
at j.init(Unknown Source)
at com.thinfile.upload.ThinSl
at sun.plugin2.applet.Plugin2
at java.lang.Thread.run(Unkno
Exception: java.lang.NullPointerExcep
load: class com.thinfile.upload.ThinSl
java.lang.ClassNotFoundExc
at sun.plugin2.applet.Applet2
at java.lang.ClassLoader.load
at java.lang.ClassLoader.load
at sun.plugin2.applet.Plugin2
at sun.plugin2.applet.Plugin2
at sun.plugin2.applet.Plugin2
at java.lang.Thread.run(Unkno
Caused by: java.io.FileNotFoundExcept
at java.io.FileInputStream.op
at java.io.FileInputStream.<i
at java.io.FileInputStream.<i
at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
at sun.plugin2.applet.Applet2
at sun.plugin2.applet.Applet2
at sun.plugin2.applet.Applet2
at java.security.AccessContro
... 7 more
Exception: java.lang.ClassNotFoundExc
--- Init applet: com.screencastomatic.detec
--- Start applet: com.screencastomatic.detec
load: class com.thinfile.upload.ThinSl
java.lang.ClassNotFoundExc
at sun.plugin2.applet.Applet2
at java.lang.ClassLoader.load
at java.lang.ClassLoader.load
at sun.plugin2.applet.Plugin2
at sun.plugin2.applet.Plugin2
at sun.plugin2.applet.Plugin2
at java.lang.Thread.run(Unkno
Caused by: java.io.IOException: open HTTP connection failed:http://dzinentertainment.com/client-manager/com/thinfile/upload/ThinSlice.class
at sun.plugin2.applet.Applet2
at sun.plugin2.applet.Applet2
at sun.plugin2.applet.Applet2
at java.security.AccessContro
... 7 more
Exception: java.lang.ClassNotFoundExc
<------------------ Original applet.php -------------------->
<?php
$useApplet=0;
$user_agent =$_SERVER['HTTP_USER_AGENT'];
if(stristr($user_agent,"konqueror") || stristr($user_agent,"macintosh") || stristr($user_agent,"opera"))
{
$useApplet=1;
echo '<applet name="Thin Slice Upload"
archive="ThinSlice.jar"
code="com.thinfile.upload.ThinSlice"
width="300" MAYSCRIPT="yes"
height="309">';
}
else
{
if(strstr($user_agent,"MSIE")) {
echo '<script language="javascript" src="embed.js" type="text/javascript"></script>';
} else {
echo '<object type="application/x-java-applet;version=1.4.1"
width= "300" height= "309" id="rup" name="rup">';
echo ' <param name="archive" value="ThinSlice.jar">
<param name="code" value="com.thinfile.upload.ThinSlice">
<param name="MAYSCRIPT" value="yes">
<param name="name" value="Thin Slice Upload">';
}
}
if(isset($_SERVER['PHP_AUTH_USER']))
{
printf('<param name="chap" value="%s">',
base64_encode($_SERVER['PHP_AUTH_USER'].":".$_SERVER['PHP_AUTH_PW']));
}
if($useApplet == 1)
{
echo '</applet>';
}
else
{
echo '</object>';
}
?>
<------------------ Absolute Path that I tried to change to fix the problem applet.php-------------------->
<?php
$useApplet=0;
$user_agent =$_SERVER['HTTP_USER_AGENT'];
if(stristr($user_agent,"konqueror") || stristr($user_agent,"macintosh") || stristr($user_agent,"opera"))
{
$useApplet=1;
echo '<applet name="Thin Slice Upload"
archive="http://domain.com/wp-content/themes/themename/ThinSlice.jar"
code="com.thinfile.upload.ThinSlice"
width="300" MAYSCRIPT="yes"
height="309">';
}
else
{
if(strstr($user_agent,"MSIE")) {
echo '<script language="javascript" src="http://domain.com/wp-content/themes/themename/embed.js" type="text/javascript"></script>';
} else {
echo '<object type="application/x-java-applet;version=1.4.1"
width= "300" height= "309" id="rup" name="rup">';
echo ' <param name="archive" value="http://domain.com/wp-content/themes/themename/ThinSlice.jar">
<param name="code" value="com.thinfile.upload.ThinSlice">
<param name="MAYSCRIPT" value="yes">
<param name="name" value="Thin Slice Upload">';
}
}
if(isset($_SERVER['PHP_AUTH_USER']))
{
printf('<param name="chap" value="%s">',
base64_encode($_SERVER['PHP_AUTH_USER'].":".$_SERVER['PHP_AUTH_PW']));
}
if($useApplet == 1)
{
echo '</applet>';
}
else
{
echo '</object>';
}
?>
<------------------ Original embed.js-------------------->
document.writeln('<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"');
document.writeln('width= "300" height= "309"');
document.writeln('codebase="http://java.sun.com/update/1.5.0/jinstall-1_5-windows-i586.cab#version=1,4,1">');
document.writeln('<param name="archive" value="ThinSlice.jar">');
document.writeln('<param name="code" value="com.thinfile.upload.ThinSlice">');
document.writeln('<param name="name" value="Thin Slice Upload">');
<------------------ Absolute Path that I tried to change to fix the problem embed.js-------------------->
document.writeln('<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"');
document.writeln('width= "300" height= "309"');
document.writeln('codebase="http://java.sun.com/update/1.5.0/jinstall-1_5-windows-i586.cab#version=1,4,1">');
document.writeln('<param name="archive" value="http://domain.com/wp-content/themes/themename/ThinSlice.jar">');
document.writeln('<param name="code" value="com.thinfile.upload.ThinSlice">');
document.writeln('<param name="name" value="Thin Slice Upload">');
ASKER
Hi Preculopsis,
Thanks very much for your suggestion. I set this up in the header:
<BASE HREF="http://www.dzinentertainment.com/wp-content/themes/default/" />
But the applet still doesn't load here:
http://dzinentertainment.com/client-manager/
It still shows this in the error:
failed:http://dzinentertainment.com/client-manager/com/thinfile/upload/ThinSlice.class
Thanks very much for your suggestion. I set this up in the header:
<BASE HREF="http://www.dzinentertainment.com/wp-content/themes/default/" />
But the applet still doesn't load here:
http://dzinentertainment.com/client-manager/
It still shows this in the error:
failed:http://dzinentertainment.com/client-manager/com/thinfile/upload/ThinSlice.class
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Oh, that's an interesting idea. I'll look into that....
ASKER
Preculopsis,
Sorry it took me so long to award points. It took me a month to test your theory about iframes, but it worked PERFECTLY. Thank you SO much for your help. Thank you for a simple, but effective answer to this question that has been haunting me for months!
Sorry it took me so long to award points. It took me a month to test your theory about iframes, but it worked PERFECTLY. Thank you SO much for your help. Thank you for a simple, but effective answer to this question that has been haunting me for months!
Just a random thought but could an html base tag help
Open in new window