I was wondering how Java applets work in regards to accessing data on a users PC. For example I wish to grab a file on their PC and send it to the web server hosting my webpage (basically a simple file transfer client program). Can this be done using something like a JFileChooser dialog?
Yes, this can be done. You can always try and check it with minimal code (quick and dirty). This, this and this might help.
Related
I am trying to make a web browser that works entirely on voice commands (i.e speech-to-text and vice versa using sphinx.)
I have a Java applet, but I don't know how to add a parser to it so that different parts of different websites go to a particular segment in my browser.
What are the necessary steps to add a parser to a web browser applet?
You don't need java applet, it creates too many issues. You need something like pocketsphinx.js:
https://github.com/syl22-00/pocketsphinx.js
This technology can give you access to content of the browser with javascript, a way easier way to manage things.
Now i am able to make a fully speech based web browser. I used Jsoup for extracting various elements of any web page. Then with the help of sphinx and freetts i allowed users to interact with browser by using speech commands only.
I am working on a project named as LMS (Learning management system) and the modules allocated to me are:-
The uploaded course content saved as ppt,doc ,pdf or audio/video file should be opened in the same window.The application by which file needs to be opened should be embedded in the context window itself.
The uploaded course content saved as ppt,doc ,pdf file can be converted to audio/video file.
I have to code them in JSP.
Being new to java i am not getting how to do these. Can you plz plz help me out by showing me some direction? I shall be very thankful to you.
I will be waiting for your reply desperately.
Thanks and regards
swati
First I have to ask do you already have a transformation server/code to do the conversion in point nbr2 or do you ask for guidance on that to? If that's the case maybe you can look into HTML5 for this otherwise use something like flash.
I would say use HTML5 for video and the other things I would require the users to install the correct plug in adobe reader ... I think it's reasonable to put requirements on the user when using an enterprise app.
Almost all of this could be done in HTML JavaScript inside your jsp.
I know that there is Vuze API and jBitTorrent library but I can't use Vuze because of I have server without GUI and jBitTorrent is too old and too buggy. Can you tell me that bittorrent library for Java is good now? I need to download files through torrent file only. Thanks.
It seems you need to run Vuze headless through it's console ui.
When I tried it with the apt-gettable Vuze on Ubuntu, I didn't need to 'grab a few support jars' as the wiki linked above specified - it just ran straight away.
You can use Transmission or µTorrent, or just run Vuze headless. With sending files to Transmission, you need to encode the binary data as base 64, with sending them to µTorrent, you need to use a multipart form via HTTP POST.
Here are their API pages:
https://trac.transmissionbt.com/browser/trunk/extras/rpc-spec.txt
http://www.utorrent.com/community/developers/webapi
just looking for a point in the correct direction..
So I've developed a little application on the back end of our websites that allows the girls in our office to send out letter-headed PDF quotations to our potential clients via email.
I've done this using a simple HTML form, the FPDF class, and the php function mail()
It works a treat, but I'd like to take it a step further and create a desktop application so that the girls don't have to go through the login section of the website to access this functionality.
I'm thinking Java?
Would this be a difficult mission someone who has only had web-developing experience?
It would only be the smallest/simplest of applications.
Thanks for any input :)
This is just an advice.
Since you have already developed something that works over web, reuse it.
Convert the PDF converter into a service to upload and retrieve file. This service should return a token_id that can be used later to download the converted files.
Write a Java app using Swing that merely uses this web service. The logic in this application should be (a) browse file from computer, (b) Use web-service upload URL to upload the file and rec/eive appropriate response like upload_token_id and status uploaded/converted/failed, (c) the Java app, should be able to use this token to download the converted file.
You may need to look into this for help related to uploading the file
No it wouldn't be difficult job to mimic your app to java desktop app that can be Java Swing APP. you just need some practice on swing. As you are doing in php that is creating PDF and mailing it. This task can easily be done in java swing by using Java Mail API for emailing and IText for pdf generation.
For reference you can read following links:
http://www.javabeginner.com/java-swing/java-swing-tutorial
http://zetcode.com/tutorials/javaswingtutorial/
http://www.apl.jhu.edu/~hall/java/Swing-Tutorial/
http://www.oracle.com/technetwork/java/javamail/index.html
http://java.sun.com/products/javamail/javadocs/index.html
http://www.javacommerce.com/displaypage.jsp?name=javamail.sql&id=18274
http://viralpatel.net/blogs/2009/04/generate-pdf-file-in-java-using-itext-jar.html
Hope this helps.
I'm trying to find something that will let users upload multiple files to a website. The requirements are that it let them easily select multiple files (preferably with something like check boxes) and that it displays a preview of the images they select.
I'd prefer to only use Javascript or Flash if possible, but Java is also an option (this needs to work on platforms where Silverlight isn't available).
So far all I've been able to find are things that use the native file selector (which doesn't show previews on Windows, and makes it unclear that you can select multiple by holding ctrl).
I'm not sure if the preview requirement is even possible, but it's the most important.
This is a firefox solution:
It uses the FileReader javascript object to load, display and upload images.
http://hacks.mozilla.org/2011/01/how-to-develop-a-html5-image-uploader/
It still doesnt show previews in the FileSelection dialog but at least allows you to preview the images before uploading.
And here is a ready made java applet solution:
http://jumploader.com/doc_overview.html
To upload multiple files I use RichFaces rich:fileUpload component.
Concerning the preview, I've got the similar problem and the best I found after couple of days of googling is following.
Alfresco has the same problem and resolved it with :
An open office which runs in server mode (socket) and all the office documents are sent by alfresco to open office in order to convert them in PDF
Those PDF are converted to .swf viewer thanks to SWFTOOLS
This .swf is integrated in the HTML
For images, it uses ImageMagick to create small version of the file I suppose
Personnaly, I will try to implement it this way :
Converting office documents to PDF thanks to open office in socket mode
Transform the first page of the PDF into a PNG thanks to JPedal library
Diplay that PNG to the end user
For images I would perhaps use ImageMagick too ... but for now, I'm using Seam Image.scaleToFit API
I am assuming 2 things here:
1) Some kind of client/enduser will be doing the file upload
2) You get some kind of say on what the client installs on their computer to help make this happen.
If this is the case, my first suggestion would be:
Give them FTP or SFTP client software to upload files. The php page you make can have a link to Filezilla, along with instructions on how to use it. ftp and sftp are THE protocols to use for transferring files. HTTP is just not designed(well) for it, nor are browsers.
Once the user has the (S)FTP client software installed, you can give them URL's to upload files to that are specific to their user account, and you can have a backend script process and load/move files that they upload. It's pretty easy to create a local temporary directory using a server side script, have the client upload files via ftp, then go back to the web browser and click a button that says "Done uploading, please process my stuff".
The browser can even give back confirmations on everything that gets uploaded/processed.