File upload applet without browsing

hi all,
i m a php developer, i need a java applet to be embedded in html, that contains a button (upload), on clicking that all text files from a predefined location, without browsing, in the clients computer could be uploaded to server.
help me from the scratch.
thankyou

Applets are a PITA. Applets that deal with the local file system need to have 'full trust' and that is a complete PITA, especially with the Vista UAC problem that restricts even trusted applets to a particular set of sub-directories (in user.home, AFAIR).
A better strategy might exist if you can..
a) write to a ZIP archive from PHP? (which can reduce all the reports to being contained in a single file*).
b) Invoke 'shell commands' from PHP, as you might from the command line interface, the Windows Command Prompt?
If both those answers are 'yes', I would recommend dumping the applet for a JWS launched application that uses the JNLP API's [file service|http://pscode.org/jws/api.html#fs].
Try especially the sandboxed version of the demo.
Using webstart, this might all be achieved 'sandboxed'.
It would work like this.
The PHP script writes all the reports to a single zip archive with file extension '.reportarchive' instead of '.zip'.
After the reports are prepared and stored, two shell commands are required.
javaws -import -association -silent http://www.our.com/upload.jnlp
..and..
javaws -open C:/the/path/the.reportarchive http://www.our.com/upload.jnlp
The first installs the uploader application to the user cache, while the second tells webstart to open the uploader app. with the reportarchive file name as the runtime argument.
Once the user has OK'd the access to the reportarchive, the rest (uploading it) can be done automatically (with a progress bar).
* Note that if you cannot easily write a Zip using PHP (shrugs) that .reportarchive file type might instead be a .reportlist which simply contains the path/names of the other report files.
If the user fails to select the 'always allow' option for the file list, they will be prompted for each file (until they do). The advantage of the archive is that the user is only ever asked once.
And as an aside, how exactly is the PHP script invoked to run?
Note that a good way to indicate interest in a solution is to add [Duke stars|http://wikis.sun.com/display/SunForums/Duke+Stars+Program+Overview] to match that interest.

Similar Messages

  • Multiple File Upload Applet

    I am attempting to code a JavaBean wrapped by an applet that will upload multiple files to a web server via the multipart/form-data mime-type.
    I have moved a number of files to the web server with limited success.
    I cannot move more than roughly 30Mbs of files in any configuration without causing a fatal exception.
    I am confident that it is a limitation of the client's VM and the memory allocated to the applet.
    I have seen several commercial grade applets that claim they can move any number of files even totalling 180Mbs.
    My applet is very simple. It opens a JFileChooser dialog box, allowing the user to select multiple files and communicates directly to a server side component that accepts multipart/form-data.
    I am navigating the protocol just fine. It seems to be a memory problem on the client side. Does anyone know how I can defeat this restriction and pass a reasonably high number of files (100-200) ranging from 50Mbs to 180+Mbs?
    Secondly, why does this happen: when I put my files onto the output stream, no files move accros the stream until I call .close(). How can I write the code to begin transferring bytes as soon as I call outputstream.write(xxx)?

    i am also developing multiple file upload applet and i transferred 1,4gb of data (2 files a 700MB) successfully.
    also, i just transferred a few hundred files with total size of 900mb to my localhost webserver (~5000kb/s)
    1) open file
    2) read a few kilobytes into buffer
    3) send them to the server
    4) flush the outputstream (!!)
    5) clear buffer and goto 2)
    6) if end-of-file, close the file and flush again.
    the outputstream is flushed every few kilobytes, so it will be sent over the socket to the server and not buffered until dawn.
    i don't know how the server-side is working, but i used apache/php script.
    you can try out my applet under
    http://www.haller-systemservice.net/jupload/

  • File Upload applet not opening in Query Mode

    File Upload Applet is opening in Query Mode in Siebel 7.5, where as in Siebel 7.8 its not opening in Query Mode.
    Should anything be changed in CFG? or siebel restricted this?

    Hi,
    There is a property called "Auto Query Mode" in the applet. Check whether this has been set to "New Query" in 7.5. If so the applet will be opening in Query Mode automatically. If this property is blank, in 7.8, the applet will not be opening in Query mode. Check and let me know.
    Regards,
    Joseph

  • Upload Friendly (Multiple File Upload Applet)

    Title : Upload Friendly (Multiple File Upload Applet)
    Description : UploadFriendly is an easy to use Java Applet that will allow multiple file
    uploads on a web server in a web page. The control supports file filtering, limits and more.
    Samples available in the following languages: ASP, ASP.NET, PHP, Coldfusion and JSP
    Link: http://www.uploadfriendly.com/
    Type: Commercial (30 days Trial)

    Hi shiil,
    To move the documents between site collection, content organizer rules would be a recommended method, you can activate Content Organizer features to enable content organizer rules on the site, to root the document to another site collection.
    Also, for this issue, as Prasath suggested, you can check out the document in the ItemAdded event, then add ItemCheckedout event, in the ItemCheckedout event, delete the document. Or as content organizer rule does, you can create your own timer job to move
    the document.
    More information, Content Organizer Feature Overview for SharePoint Server 2010 Developers (ECM):
    http://msdn.microsoft.com/en-us/library/office/ee558288(v=office.14).aspx
    Thanks,
    Qiao Wei
    TechNet Community Support

  • Applet without browser

    Hi
    How do i execute applets without using a browser or the appletviewer .
    Basically i want to develop an application using applets only . The application will not have any browsers.
    Is this possible . If yes how ?.
    Regards
    Ajoy

    Take this program, change TheApplet to youe applet name and run it.
    import java.awt.*;
    import java.awt.event.*;
    public class bullM extends Frame
         TheApplet   applet = TheApplet  ();
    public bullM()
         super();
         setLayout(new BorderLayout());
         setBounds(6,6,740,470);     
         addWindowListener(new WindowAdapter()
        {     public void windowClosing(WindowEvent ev)
                   applet.stop();
                   applet.destroy();
                   dispose();     
                   System.exit(0);
         add(applet,BorderLayout.CENTER);
         setVisible(true);
         applet.init();
         applet.start();
    public static void main (String[] args)
         new bullM();  
    Noah

  • Help! ... file upload applet

    Hey
    I am searching the net for a couple of days now ... I need to find a solution for uploading files without the user browsing for them.
    I can't use the <input type="file"> so I turned to activex and applets...
    I would like to build an applet which throught javascript specify a path for it and then the applet will send the files one by one to the server.
    I tried to read the files as binary with the activex adodb.stream with no luck!
    I don't know what else to do ! ... please please help me!
    I am willing to try anything to solve this problem
    Thanks a lot!!

    You can do it with an outputstream and an inputstream....
    in the applet (put this in a thread):
    URL url = new URL("www.abc.com/yourservleturl");
    URLConnection urlConnection = url.openConnection();
    urlConnection.setDoOutput(true);
    urlConnection.connect();
    OutputStream out = urlConnection.getOutputStream()
    BufferedOutputStream bos = new BufferedOutputStream(out);
    File file = new File("your local file");
    InputStream in = new FileInputStream(file);
    BufferedInputStream bis = new BufferedInputStream(in);
    int i = 0;
    while((i = bis.read()) != -1) {
        bos.write(i);
    bos.flush();in the Servlet:
    BufferedInputStream bis = new BufferedInputStream(request.getInputStream());
    bis.read(); // here you get your file........ do whatever you want........

  • File upload applet recommendations

    Greetings,
    We are building a large-scale extranet that will heavily
    involve user uploads of various files, including potentially large
    videos. In the past we've just used file fields and handled the
    stream with cffile and cfftp. However, we are thinking that we need
    a java applet for two reasons:
    1. to allow multiple files at once (this is not critical)
    2. to be able to check file size on the client (this would be
    extremely helpful), and stop the upload if it's too large.
    At launch, users will all be on Macs and Firefox--however, as
    things do this could always change; it is assured though that we
    will never be able to specify all-windows, so I assume that activex
    is "right out". As with any of our assumptions, please set us
    straight!
    Once any files are uploaded, we will need to database the
    file information (it will be placed into a kind of cms), so it's
    going to have to be more than "dump into a folder". Ideally the
    applet could "hand off" to a CF process that would do this; I
    suppose that we could also set up a kind of listener for the upload
    directory but this seems less then ideal. Again, ideas on how this
    might work would be welcome.
    Related to the process: we've used various image-manipulation
    server-side programs with CF, but don't know of any for video.
    Anything that might be able to manipulate video we'd love to hear
    about, even if it's some monster server/package.
    Thanks,
    Rick

    Hi,
    There is a property called "Auto Query Mode" in the applet. Check whether this has been set to "New Query" in 7.5. If so the applet will be opening in Query Mode automatically. If this property is blank, in 7.8, the applet will not be opening in Query mode. Check and let me know.
    Regards,
    Joseph

  • Running Applet without Browser

    Hello All,
    I've developed a test applet which contains a button.
    When i click the button a Frame opens and does whatever i try to do,
    Thus,to Run my applet i type the URL in the Browser and click the button to open the Frame.
    My Problem is the Frame is destroyed as soon as the browser is closed!
    I need the frame to be browser independent.
    Could anybody suggest me how this would be possible?
    Thank you!

    Applets are intended to be run in browsers.
    There is a program included with the JDK that can run an applet - look for the appletviewer program. There are insructions on its use in the Java tools documentation.
    It sounds like you should be running a Java application, not an applet.

  • Help: how can web form shown without browser frame at all

    Hi,
    I upgraded to 9i form from 6.0. I want to show form without browser frame. So I used seperateFrame=true in formsweb.cfg and I use IE=JInitiator. (I tried to use IE=native, which didn't work). I have form developer installed in my window 2000 computer and tested it, it did show applet without browser. However, when I deployed to Unix AS, it still embeded in browser frame with same configuration file. I don't know why. Could someone give me some suggestions? I really need to take off the browser frame (just taking off toolbar or task bar,etc is not good enough). Also, can someone tell me what else need to be done without using JInitiator and if it will take the browser frame off too? Thanks,
    Sa

    When you say "the same configuration file" do you mean literally the same configuration file i.e. a copy of the file uploaded via FTP (or similar)? If so, did you run the dos2unix command (or similar) to strip out the spurious control characters?
    Cheers, APC

  • Problem in Uploading a File by Applet

    Hi Members,
    * I have faced problem while uploading a file from client to server by ftp protocol using APPLET(No JSP) only
    * I am getting exception while running....
    * My source code is as follows,
    import java.awt.*;
    import java.applet.*;
    import java.awt.event.*;
    import java.io.BufferedInputStream;
    import java.io.BufferedOutputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.URLConnection;
    public class UploadAndDownload extends Applet implements ActionListener {
         Button upload;
         Button browse;
         TextField filename;
         File source = null;
         Label name;
         StringBuffer sb;
         BufferedInputStream bis = null;
         BufferedOutputStream bos = null;
         public void init() {
              setLayout(new FlowLayout());
              upload = new Button("Upload");
              browse = new Button("Browse");
              name = new Label("Filename");
              filename = new TextField("", 45);
              add(name);
              add(filename);
              add(upload);
              add(browse);
              upload.addActionListener(this);
              browse.addActionListener(this);
         public void actionPerformed(ActionEvent evt) {
              // Code for browsing a file
              String input_file_name = "";
              if (evt.getSource() == browse)
                   Frame parent = new Frame();
                   FileDialog fd = new FileDialog(parent, "Select a file", FileDialog.LOAD);
                   fd.setVisible(true);
                   input_file_name = fd.getFile();
                   filename.setText(input_file_name);
                   // Gets the file from the file dialog and assign it to the source
                   source = new File(input_file_name);
                   repaint();
              // Code for Uploading a file to the server
              if (evt.getSource() == upload) {
                   // Appending the server pathname in string buffer
                   sb = new StringBuffer("ftp://");
                   sb.append("2847");
                   sb.append(':');
                   sb.append("Websphere25");
                   sb.append("@");
                   sb.append("172.16.1.111");
                   sb.append('/');
                   sb.append(input_file_name);
                   sb.append(";type=i");
                   try {
                        URL url = new URL(sb.toString());
                        URLConnection urlc = url.openConnection();
                        bos = new BufferedOutputStream(urlc.getOutputStream());
                        bis = new BufferedInputStream(new FileInputStream(source));
                        int i;
                        // Read from the inputstream and write it to the outputstream
                        while ((i = bis.read()) != -1) {
                             bos.write(i);
                   } catch (MalformedURLException e) {
                        e.printStackTrace();
                   } catch (IOException e) {
                        e.printStackTrace();
                   } finally {
                        if (bis != null)
                             try {
                                  bis.close();
                             } catch (IOException ioe) {
                                  ioe.printStackTrace();
                        if (bos != null)
                             try {
                                  bos.close();
                             } catch (IOException ioe) {
                                  ioe.printStackTrace();
    MY EXCEPTION IS,
    Exception in thread "AWT-EventQueue-2" java.security.AccessControlException: access denied (java.net.SocketPermission 172.16.1.111:80 connect,resolve)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkConnect(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.http.HttpClient.<init>(Unknown Source)
         at sun.net.www.http.HttpClient.New(Unknown Source)
         at sun.net.www.http.HttpClient.New(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.ftp.FtpURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.ftp.FtpURLConnection.getOutputStream(Unknown Source)
         at UploadAndDownload.actionPerformed(UploadAndDownload.java:68)
         at java.awt.Button.processActionEvent(Unknown Source)
         at java.awt.Button.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)* Please let me know what problem in my code....
    * Thanks in advance....

    * Thanks for your reply....
    * I have signed my policy file by giving AllPermission and mentioned in java.security file in bin folder....
    * My question is , by giving AllPermission , can we access and do all permissions like ( SecurityPermission, AWTPermission, SocketPermission, NetPermission, FilePermission, SecurityPermission etc )...
    * My policy file is looks like follow,
    /* AUTOMATICALLY GENERATED ON Tue Apr 16 17:20:59 EDT 2002*/
    /* DO NOT EDIT */
    grant {
      permission java.security.AllPermission;
    };* If i signed the policy like above, and when i run the applet file in InternetExplorer now , it thorws the following exception on my console,
    java.net.ProtocolException: cannot write to a URLConnection if doOutput=false - call setDoOutput(true)
         at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
         at sun.net.www.protocol.ftp.FtpURLConnection.getOutputStream(Unknown Source)
         at UploadAndDownload.actionPerformed(UploadAndDownload.java:68)
         at java.awt.Button.processActionEvent(Unknown Source)
         at java.awt.Button.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)* Please let me know , how to solve this and give me your suggestion on the above process...
    * Thanks in advance...
    Regards,
    JavaImran

  • How to allow user upload file on applet??

    Sorry I'm new to programming here, but I'm trying to allow user to upload a file to the server so the program inside the server can user the file as input.
    I've noticed that JFileChooser, the ideal class for this, is not allowed on the applet, so I don't know how to go about doing this.
    Thanks for any input!

    ok
    you wish to transfer a file from applet to server.
    1. Applet gets the file
    the applet needs to access the file System therefor it must b a signed applet to get aound the security restrictions. This is why the JFileChooser doesn't work. Check out the tutorials on jars and applets, particularly the security notes.
    2. opens a connection with the server
    so the applet has a file and needs to send it. there needs to be a service of some form on the destination computer to execpt the file. Perhaps you write your own perhaps you use HTTP.
    3. server software stores the file
    where an applet is an mini application that runs within the confines of the web browser. a SERVLET is a service program which runs with in the confines of a server, such as a web server.
    this is a lot easier to do HTML rather that applet in my opinion but which ever.

  • Cannot upload some files to Dropbox through browser UI

    I love and defend Firefox but I have to admit that it is giving me some grief lately. I run a Dropbox account which I access through the browser and its UI allows for drag and drop file uploads as well as more 'conventional' file uploading. In recent days I find certain file uploads are OK via Firefox (such as a 1mb PDF) but I cannot upload for instance a 30mb MP3 or a ZIP file - it tries but ultimately fails. A small 500kb MP3 is fine so it seems to be a file size rather than file type issue (there is a Dropbox limitation on file size but I am way below that). Also when using Firefox with the same Dropbox UI, I get odd errors like 'folder does not exist' even when I am not trying to access a folder or 'there was a problem completing the request' when trying to access a folder, even when it then allows access. I have raised all this with Dropbox forum and I am advised it is a browser problem (they would say that right?). However, I have control-tested using Safari and IE, etc, and I cannot replicate any of the problems. Uploads of large files (the exact same files) are fine in those browsers, no odd errors while testing. I was using Fx V 22x on Win7 x64 Pro but today got a push notification to update to Fx v23.0.1 which I have done, but still these problems persist. My plugins were few, long installed, and sound (Tabmix Plus, Firebug, FireFTP, etc) and not conflicted or out of date. Java was not enabled in the browser. However, to further control test, I have just done a Firefox RESET from the help menu and tried again without any plugins running. Same problem with larger file upload. It seems Firefox is having some issues doing things that other browsers are fine about...

    I have suffered from this during the past three days.
    Firefox 23.0, Mozilla Firefox for Ubuntu canonical - 1.0
    on a 32-bit Ubuntu PC. So the system couldn't be more different.
    I was trying to upload .MP3 files of 27MB. From about a dozen attempts with one file, no success whatever. On the other hand a different file worked first time. But a later attempt with a 14 MB .wav failed, so it's not related to the file.
    On the other hand an upload with Chrome worked perfectly. So it does look like a browser problem.
    Watching the system monitor during upload, it runs freely for about 9MB, then stops abruptly. At the same time, the message at the bottom left of the browser window, relating to dl-web.dropbox, disappears.
    The text of the message differed between Firefox & Chrome, but I imagine that's just a textual, rather than a functional, difference.

  • Upload http file using applet

    Hello every body,
    I am trying to upload the http file using applet. Can any body give me the hint or example.
    Thanks in advance
    best regards

    any of several libraries are out there that would let you to HTTP File Upload to a web server, assuming the web server has a servlet or other thing to accept the file.
    Of course, where you get the file might be a problem without a signed applet.

  • File Uploader Java Applet cannot be run

    I have a website that I need to upload PDFs to, but since ugrading to Lion, I cannot do it any more.  I have downloaded the separte Java app, but it still does not work.
    This is the error message I get:
    File Uploader Java Applet cannot be run. Make sure that Java is installed on your PC and Java applets are permitted in browser settings. Use this link to download and install appropriate version of Java:

    Thank you etresoft - that did not solve the problem.  However, I did fix it by changing something in Java Preferences (which is located in the Utilities Folder).
    I first deleted the cache files as you suggested in the Network tab.  Then I quit and restarted Firefox.  I still got the same error message when I tried to upload.
    Then, I went back into Java Preferences and checked the box, "Enable Appplet Plug-in and Webstart Applications" located in the General Tab.  I then quit and restarted Firefox.  Now I am able to upload documents as I could before Lion.
    Thank you!!

  • Can a file be uploaded automatically without

    browsing to it. i have an app that was searching for an id and getting data back on the next page then creating a text file and writing to it. can i have that file uploaded after it has been written to it without a user browsing to where it is? need a little direction please?
    thanx

    how to receive the uploaded file with servlet's request ?

Maybe you are looking for

  • Unable to download apps - wrong operating system error

    I have Windows 7 Professional with service pack 1 installed.  Still receiving error messages that apps won't work with my operating system.  According to system requirements, I should be fine.  Ideas?

  • Windows Installer Source and software repair

    Hi everyone, I am looking at how the Windows Installer Source Location should work on SCCM 2012 R2. Here is my problem: We are using a Powershell wrapper to install all the software we have. When creating a new application, we are setting the MSI pro

  • Page breaks and 'Fit Page in Window' option

    This may seem a stupid question but indulge me: when I add a page break InDesign is only showing me the very top of the text frame on the page the cursor has moved to. How do I get InDesign to honour the 'Fit Page to Window' option when I add page br

  • Vendor master dual control

    Hi gurus, Is there possible to have 2 different groups of ppl control & confirm vendor master changes to different sensitive fields. How? for example, group 1 can only confirm the changes made to address related fields. group 2 can only confirm  chan

  • ESS & MSS Forms

    Please could someone give me a list of Forms that comes as standard in ESS & MSS (erp 2005) Thanks