Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsDiscussion Forum → Any Smarties can program Java?
12
Any Smarties can program Java?
2004-09-17, 2:23 AM #1
I've been working on the new file submission routine for the new files section. The way I have been doing it is turning out to be way too complicated and way too annoying. Basically, you would fill out a web form and then it would give you a confirmation number which you would put in the subject line of an email, then use that to submit an attachment which we could process... but it's a pain and I'll end up having to build a bunch of different options for submitting urls, ftp urls, handling multiple attachments, etc. The email part is already slow...

So, I looked over at pcgamemods.com and I noticed that they had a java file uploader. That's the best idea ever! It's a small applet that shows the progress of your FTP upload. This will get you around the PHP attachment size limit as well as the problem of not knowing how much progress your upload has made.

The problem with the applet they use is that it costs $200.00 for the commercial version (they are still using the demo version... ugh), and it doesn't appear to work on Linux at all. Java is supposed to be cross-platform, so wtf? The applet actually loads on linux, but the file selector doesn't allow me to select or submit files.

So, I was wondering if anyone here in college or something has had any experience programming Java? I could probably spend a couple of weeks figuring enough out to write a simple applet, but it's probably easier for one of you. Basically, we just need it to allow the user to select a file, then send that file over FTP to the massassi server (which will be hardcoded into the applet or something?).

I even found a free ftp component that looks really easy to work with, I just don't know enough about java to make the simple applet.

http://www.jibble.org/simpleftp/

So anyway, let me know.
2004-09-17, 5:19 AM #2
I'm learning some Java. I'll try my fortune.
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2004-09-17, 5:25 AM #3
im learning java now but i'm still a noob
whenever any form of government becomes destructive to securing the rights of the governed, it is the right of the people to alter or to abolish it
---Thomas jefferson, Declaration of Independance.
2004-09-17, 5:30 AM #4
I make no promises, but I'll certainly have a look into it for you Brian :D. I haven't had that much exposure to Java communication over networks, but now seems to be as good a time as any, not to mention I've been meaning to look at the new IO libraries (java.nio) introduced in Java 1.4 :D

-Jackpot
"lucky_jackpot is the smily god..." -gothicX
"Life is mostly froth and bubble, but two things stand in stone,
Kindness in another's trouble, courage in your own"
- "Ye Wearie Wayfarer"
|| AI Builder: compatible with both JK & MotS || My website ||
2004-09-17, 10:17 AM #5
I might take a look at it next week whilst i'm without internet access.
Detty. Professional Expert.
Flickr Twitter
2004-09-17, 12:46 PM #6
Thanks everyone!
2004-09-17, 12:55 PM #7
Yeah, PHP upload limit is annoying. I have to deal with it when I upload files to my server, no FTP at college here, so I use a web-based thing.

I'm afraid I can't help you with Java though. :( Perhaps anonymous FTP could be considered as a temporary alternative?

2004-09-17, 1:45 PM #8
I haven't made a Java applet in a while now. But I have not forgotten it all. Besides, it is much like C++. But I haven't played with using forms. I'll have to learn that API and see how it's done.

I'd say go with the ones most proficient in Java. Curious though, have you also researched other CGI methods such as Perl? Does Massassi run on a windows server?
Code to the left of him, code to the right of him, code in front of him compil'd and thundered. Programm'd at with shot and $SHELL. Boldly he typed and well. Into the jaws of C. Into the mouth of PERL. Debug'd the 0x258.
2004-09-17, 2:08 PM #9
Yeah, it's on a windows server and there is a limit to the size of the file you can HTTP upload. I think it's 2mb or something, not near big enough.
2004-09-22, 6:17 PM #10
Any luck?
2004-09-22, 7:14 PM #11
Yes. I'll post some screenshots as soon as I get on my other computer.
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2004-09-22, 7:29 PM #12
Thanks a lot!
2004-09-22, 7:30 PM #13
Considering Java has that practically built in, it shouldn't be hard.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2004-09-22, 7:34 PM #14
I kept getting crash errors when trying to use the swing file selector and I couldn't figure out why. Thus my plea for help :)
2004-09-22, 8:35 PM #15
Quote:
Originally posted by Brian
....I think it's 2mb or something, not near big enough.

Ive transfered files much larger than that over HTTP POST without problems... :confused:
And when the moment is right, I'm gonna fly a kite.
2004-09-22, 8:55 PM #16
I did two semesters of Java...

...and forgot it all :(
2004-09-22, 9:22 PM #17
incidentally, my Java isn't working. I know this is off topic, but I thought i would try my luck.

When I try running a java applet in firefox, i get this:
Code:
removed because of sidescrolling -Brian


Anyways... do you think that forcing people to install java just to upload a file is too much work on the user's part for a simple task? Personally I don't mind the trouble, but it's not working for me right now.

Anyways, keep up the good work Brian. :)
2004-09-22, 9:23 PM #18
I work with Java a lot .. but seeing as everyone else has already offered, I'll just be here and not do anything, unless everyone pulls out xP
一个大西瓜
2004-09-22, 9:47 PM #19
2 MB limit on uploads...? Whaaaat? I somehow do not believe that. That has to be a configuration setting. If that is something you cannot change, well that is that.
Code to the left of him, code to the right of him, code in front of him compil'd and thundered. Programm'd at with shot and $SHELL. Boldly he typed and well. Into the jaws of C. Into the mouth of PERL. Debug'd the 0x258.
2004-09-22, 10:00 PM #20
We can't change the http upload limit. It's built into both php and IIS which is what we're running now. Remember, we get the service from recon.

The nice thing about a java applet is that it can report the progress, potentially continue if a file gets cut off, and it's cross platform and as easy to use as an http upload.

Mystic0, that sucks that your java doesn't work, but I think most people won't have a problem installing and using java, simply because most users are on windows and it's a no-brainer to download the j2re from sun and just run the installer.

Of course you can still email files, no biggie, but I'm trying to make the process more automated, and the easiest way to do that is to make it so we don't have to check the email and upload the file, we just go to the web interface and approve or deny a file.

I originally wanted to write a script to check the email for us, and it's going quite well, however, you can't transfer a file directly from the email to a filesystem (or at least I couldn't with php). You have to slurp the whole thing into memory first, and of course, php has a memory usage limit and if you try to read a 30mb file, it will get all screwed up.
2004-09-22, 10:07 PM #21
Meh, I'm sure I'll get it working... after all, I didn't install it until I saw this thread.
2004-09-22, 10:10 PM #22
BTW: I couldn't get it working with firefox, only opera. I almost thing something is wrong with firefox on linux and getting java working.
2004-09-22, 11:18 PM #23
I learned Java in college...

forgot most of it tough.
The BlackPanther
Making 3D models one vertex at a time... and wether you like it or not!
2004-09-23, 7:54 AM #24
Quote:
Originally posted by Brian
BTW: I couldn't get it working with firefox, only opera. I almost thing something is wrong with firefox on linux and getting java working.


Well, my problem is system wide. I know I have gotten Java working with Firefox in the pat, so I don't think this will be too much of a problem.
2004-09-23, 11:13 AM #25
Here's a quick update on my status:

[http://www.sestus.net/images/javasys.JPG]
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2004-09-23, 11:20 AM #26
Quote:
Originally posted by Lord_Grismath
Here's a quick update on my status:

[http://www.sestus.net/images/javasys.JPG]

That looks really interesting but I'm not sure you understand what we need? I was talking about a java applet that runs inside a browser and has a simple file selector where you select a local file, press upload, and it ftp uploads it to our server. Then it forwards them to another page and passes the filename as a parameter. Then my php will take over again and allow them to type in more information about the file.
2004-09-23, 11:25 AM #27
Thanks for the constructive crit, Brian, I guess this won't be necessary, then:

[http://www.sestus.net/images/javasys2.JPG]

These actually can be interpreted as applets, too, I believe. Anyway, these are just the bones of the program. I'll get to 'sprucing it up' later.
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2004-09-23, 11:38 AM #28
I still don't think I'm making myself clear? It needs to run in a browser and it shouldn't care about what type of level or file you're uploading or anything. All it needs to do is ftp transfer a file from the local computer up to my server (I will provide an ftp host/login/password) - all will get dumped into one directory and I will handle all processing from there.

It looks like you're writing a whole file management software?
2004-09-23, 4:20 PM #29
Brian, I'm having semi-luck with the edtFTPj API for Java. Java's built in FTP API sucks, and this one is really nice but I can't seem to get it to work in an applet, only an application. I may revert to some code I found for uploading/downloading files using Java's URL handlers, more on it later.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2004-09-23, 4:24 PM #30
Quote:
Originally posted by Emon
Brian, I'm having semi-luck with the edtFTPj API for Java. Java's built in FTP API sucks, and this one is really nice but I can't seem to get it to work in an applet, only an application. I may revert to some code I found for uploading/downloading files using Java's URL handlers, more on it later.

It may suck but would that mean I would have to find and search for this API in addition to downloading Java?
Code to the left of him, code to the right of him, code in front of him compil'd and thundered. Programm'd at with shot and $SHELL. Boldly he typed and well. Into the jaws of C. Into the mouth of PERL. Debug'd the 0x258.
2004-09-23, 5:11 PM #31
No, but the FTP is unsupported, so no documentation.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2004-09-23, 5:13 PM #32
Okay, my java is working now... I had to recompile X Windows (xorg-x11) with xprint support enabled.
2004-09-23, 5:37 PM #33
Thanks guys for all the help, I look forward to seeing what you come up with! For the end user, all they would have to do is load the page, don't worry about downloading external libraries or whatever, those all get compiled into the program itself which is in turn embedded into a web page.
2004-09-23, 5:49 PM #34
Sounds great! :)
2004-09-23, 7:43 PM #35
Alright, I got edtFTPj working. It's the best, most reliable FTP API for Java.

Just a note, the applet must reside on the same server, otherwise the virtual machine won't let the applet connect without it being a signed applet. It's just a security feature of Java.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2004-09-23, 8:33 PM #36
Brian, I have to confess, it was all a horrible, horrible joke. My expertise in Java is still very primitive, and I doubt that I'll be any real help in the near future. Sorry. :[
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2004-09-23, 8:39 PM #37
Quote:
Originally posted by Emon
Alright, I got edtFTPj working. It's the best, most reliable FTP API for Java.

Just a note, the applet must reside on the same server, otherwise the virtual machine won't let the applet connect without it being a signed applet. It's just a security feature of Java.
What exactly do you mean? It just has to be on the same server as massassi.net? That's no problem. I'm expecting a small window to pop up asking if it's okay to access the local filesystem, I think that's pretty normal right?
2004-09-23, 8:40 PM #38
Unsigned applets can read, not write. So no popup.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2004-09-23, 8:58 PM #39
Well, I'm having a bit of trouble getting edtFTPj working with an applet. I posted on their forums, I should have a reply within a day or two, they're usually pretty fast.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2004-09-23, 9:04 PM #40
Thanks a lot, Emon.
12

↑ Up to the top!