Opening a client file problem

Building a swing client mail application has one huge hickup and can't think of a good solution. How do you automatically open an email attachment?? If its a .doc document, it should open a word document automatically instead of reinventing the wheel and code some Java RTF viewer.
A lot of attachments are compressed, you mean you have to code it all in Java? That would be absurd? With 100 now common mime types, anyone have any good suggestions of doing this.
For example - Would the windows "start" command be a good idea to simply open the folder if not a text/html or image (gif/jpg) file?
What about linux and unix and mac?? Whats the OS command to open the mail cache attachments folder? Not happy that Java doesn't support a native method to open a file. Why is that?
Hope people reply to this and bring some ideas that are effective and would not be too troublesome to implement or re-invent the wheel??
Thanks
Abraham Khalil

I realize this is about a year late, but in case anyone stumbles across this in a query here's my two cents:
I haven't researched this thoroughly enough to explain how it works, but I researched it enough to produce working code. This worked on... let me see... Windows 2000, 98, and Mac (running 1.3.1, but it should work with 1.4.2 too).
Note this referenecs a few of my own classes...
     /** Triggers the OS to open a file with its default application.  Returns true if successful.
     public static boolean openFile(File file) {
          Process process = null;
          if(usingMac) {
               try {
                    // from: http://www.jguru.com/faq/view.jsp?EID=430093
                    String[] cmd = {"open",file.getAbsolutePath()};
                    process = Runtime.getRuntime().exec(cmd);
               } catch(Throwable t) {}
          } else if(usingWindows) {
               try {
                    I found an amazing trick at:
                     http://www.michael-thomas.com/java/javacert/MyLaunchDefaultBrowser.html
                     Basically this means Windows decides how to open a program.
                    String cmd = "rundll32 url.dll,FileProtocolHandler" + " "+file.getAbsolutePath();               
                    process = Runtime.getRuntime().exec(cmd);
               } catch(Throwable t) {}
          if(process==null) return false;
          while(true) {
               try {
                    return (process.waitFor()==0);
               } catch(InterruptedException e) {}
               //don't hog the CPU while our other process is working:
               try {
                    Thread.sleep(20);
               } catch(InterruptedException e) {
                    Thread.yield();
     }We encountered 1 problem with the code above:
Under really restricted settings on Mac, the code above would refuse to open a "help.html" file. So in addition to the code above, we now check the file type. if it's HTM or HTML, we trigger the browser-specific code. Of course this only helps with HTML files (or other browser-friendly files), but in this case it was enough to get by.
Lots of useful info about java-working-with-browsers is available here:
http://ostermiller.org/utils/Browser.html
As a closing note: are you sure you want to automatically open attachments? That's the kind of feature viruses prey on. Not to mention trojan horses. It's a huge security risk to open a file like that; I would only consider it:
1. If I were operating in a closed network.
2. If I had a virus-checking program nearby, and before launching a file I could ask it to check it for me.
Even then I'd make the user very aware of the risks involved, and would not enable it by default.
hope this helps. Sorry nobody responded sooner.

Similar Messages

  • Opening a PDF file problems.

    I have Version 9 installed on my laptop and sometimes when I open a PDF file I get a message saying file is damaged and cannot be opened do I close it and try again and it will open. It does not matter if it isn a old file or a brand new one. Can anyone help me please?
    Thanks

    Hi Francisco,
    In the AccessGate screen for the WebGate, if you have the CachePragmaHeader and CacheControlHeader set to "no-cache", try setting them to "public" (or blank), restart the web server, and see if that resolves the issue.
    Regards,
    Colin

  • Opening a client file - Mail attachments for example

    Building a swing client mail application has one huge hickup and can't think of a good solution. How do you automatically open an email attachment?? If its a .doc document, it should open a word document automatically instead of reinventing the wheel and code some Java RTF viewer.
    A lot of attachments are compressed, you mean you have to code it all in Java? That would be absurd? With 100 now common mime types, anyone have any good suggestions of doing this.
    For example - Would the windows "start" command be a good idea to simply open the folder if not a text/html or image (gif/jpg) file?
    What about linux and unix and mac?? Whats the OS command to open the mail cache attachments folder? Not happy that Java doesn't support a native method to open a file. Why is that?
    Hope people reply to this and bring some ideas that are effective and would not be too troublesome to implement or re-invent the wheel??
    Thanks
    Abraham Khalil

    If you peruse cross-platform browsers and mail clients (like Mozilla), you'll see that most provide in their editable configurations a mapping of mime-types to applications. Using this, a user can specify what command to give to the hosting platform to execute when a mime-type is opened.
    Some platforms, like windows, provide a mime-type mapping service. You can add platform specific code to take advantage of this. Mozilla allows you to, for a mime-type, specify the default application from the platform or your own.
    Compressed files also have their own mime-type, so the associated application would take care of that.
    I hope you find this of some help.

  • File transfer Open dataset CSV file Problem

    Hi Experts,
    I have an issue in transferring Korean characters to a .CSV file using open dataset.
    data : c_file(200) TYPE c value '
    INTERFACES\In\test8.CSV'.
    I have tried
    open dataset  c_file for output LEGACY TEXT MODE CODE PAGE '4103'.
    open dataset  c_file for output    in TEXT MODE ENCODING NON-UNICODE.
    open dataset  c_file for output    in TEXT MODE ENCODING Default.
    Nothing is working.
    But to download to the presentation server the below code is working. How can the same be achieved for uploading the file to application server.
    CALL METHOD cl_gui_frontend_services=>gui_download
          EXPORTING
            filename                = 'D:/test123.xls'
            filetype                = 'ASC'
            write_field_separator   = 'X'
            dat_mode                = 'X'
            codepage                = '4103'
            write_bom               = 'X'
          CHANGING
            data_tab                = t_tab
          EXCEPTIONS
            file_write_error        = 1
            no_batch                = 2
            gui_refuse_filetransfer = 3
            invalid_type            = 4
            no_authority            = 5
            unknown_error           = 6
            header_not_allowed      = 7
            separator_not_allowed   = 8
            filesize_not_allowed    = 9
            header_too_long         = 10
            dp_error_create         = 11
            dp_error_send           = 12
            dp_error_write          = 13
            unknown_dp_error        = 14
            access_denied           = 15
            dp_out_of_memory        = 16
            disk_full               = 17
            dp_timeout              = 18
            file_not_found          = 19
            dataprovider_exception  = 20
            control_flush_error     = 21
            not_supported_by_gui    = 22
            error_no_gui            = 23
            OTHERS                  = 24.

    Hi,
    I would recommend to use OPEN DATASET ... ENCODING UTF-8 ...
    If your excel version is unable to open this format, you can convert from 4110 to 4103 with report RSCP_CONVERT_FILE.
    Please also have a look at
    File upload: Special character
    Best regards,
    Nils Buerckel

  • "There is a problem with your account..." when opening online OneNote file within local OneNote app

    Hi,
    We have a tenancy DirSync connection a small number of staff so that they can have access to SharePoint, Visio and OneNote Online. When one such user logs onto the http://[groupsite].sharepoint.com site on his Windows 7 PC with Office 2013 installed,
    he can access the site successfully. He might then open a OneNote file online. However, if he was to then click the "Open In OneNote" button from the toolbar, and clicked "Yes" to the Microsoft OneNote Security Notice:
    "Microsoft Office has identified a potential security concern. This location may be unsafe".
    ... and then sign in with the same account to this box
    ... and then enters his correct credentials into the next "Sign In" window, it returns with the following message:
    "There is a problem with your account. Please try again later".
    Finally, the following message is returned within the MS OneNote app:
    "We couldn't open that location. It might not exist or you might not have permission to open it. Please contact the owner of onenote:https://[groupsite].sharepoint.com/sites/....one#SharePoint Team Site for more information."
    The user has reinstalled MS OneNote 2013 on the PC with no change. We have also removed all cached credentials from within Windows Credential Manager and rebooted with no success. The user can access all web-based resources such as SharePoint, OneNote and
    Visio, and he can open web-based Visio files locally on the locally-installed Visio app with no issues. This problem is specifically experienced when opening an online version of OneNote locally on a  PC that has either MS OneNote 2010 or OneNote 2013.
    Any assistance that you may be able to provide would be greatly appreciated.
    Regards,
    Brian

    Thanks Maurice, for your reply.
    My Windows Account is already used to log into OneNote. It is the same Windows Account used to log into, and access online, the SharePointOnline, OneNote Online, etc., services. I tried, indeed, to sign out from my account within the client-version of OneNote
    but it returns the message "We can't remove Windows accounts".
    Again, this is the only account that has been used with this installation of OneNote, and it is that which has been uploaded by way of DirSync to Azure. It works for online versions of OneNote items, SharePoint and Visio, and for VisioOnline-based files
    that are opened within the local client-version of Visio. When trying to open the OneNote Online notebook within the local client-version of OneNote we get this issue.
    I have reinstalled Office with no success.
    Any help that you can provide in this regard would be greatly appreciated.
    Regards,
    Brian

  • Problems opening & printing pdf files created on a Mac

    I am at my wit's end! I recently upgraded to a new version of Acrobat and suddenly a lot of my clients could no longer open my pdf files. I uninstalled the latest version of Acrobat and reinstalled an older version (Acrobat 8.1.3). Some clients started being able to open my pdf files but others could not. So I started using the Acrobat Share server and sending links. Some of my clients cannot open those either and many cannot print even if they can open the files that way. I personally also cannot print from the Acrobat Share server. The pdf files print out with all the surrounding graphics and application design elements. I also can't open the pdf files that I created on my Mac using my PC laptop running Vista. I have tried opening and printing both pdf files and the Acrobat Share links from my Mac and my PC laptop running Vista, to no avail.
    I was under the impression that compatibility problems between Macs and PCs were largely a thing of the past. I was also under the impression that the whole point of exchanging pdf files was that pdf files are cross-platform compatible. Not only am I am losing tons of valuable time, I may be losing credibility with my clients (especially since I have an IT background). I desperately need to know what version of Acrobat I should be running on my Mac so that when I scan documents into my Mac, the pdf files that are created are completely 100% compatible with both Mac and PC operating systems regardless of what operating system and what version of Acrobat my clients are running. I also need to be sure that those same pdf files I create on my Mac can be seemlessly printed out from either a Mac or PC regardless of the operating system or Acrobat Reader version. If anyone can help me get to the bottom of this, I will be eternally grateful. Thanks.

    This file downloaded and works fine for me in Preview on both OS X 10.5.7 and 10.4.11 (and opens in Acrobat Pro 9.1.1 and 8.1.5, and the latest version of Reader on both versions of the OS). As expected.
    If you're printing from Acrobat.com by right clicking in the image area and selecting Print, don't. This isn't printing the PDF, it's printing the Flash frame that contains, as you've noticed, buttons and other elements. (Adobe's Mac Flash plugin is notoriously buggy.) Direct your clients to download the file by selecting the download button, not by right clicking and printing.
    Again, your PDF file is fine.

  • Client can't open my BMP files

    Howdy,
    I've been using my current system to create software interface graphics (buttons, icons, etc. ) but recently my clients who are all on Windows are not able to open my BMP files. They can open PSD and PNG and JPG files, to problem. I need the BMPs because of the alpha channel.
    Now, don't laugh, this "old, basic" system has served me well for many years and I'm in no mood or financial situation to upgrade, so I'm hoping that the problem is not related to the age of the system. I'm running:
    CS1 (Photoshop 8.0, MIcrosoft Bitmap File Format 8.0) on a G5 iMac with system 10.4.11
    Thanks for any suggestions you might have.

    I imagine that that error code 14 was accompanied by some verbiage. It is often the case that said verbiage actually points you in the right direction as to what the problem is. The error code alone is only going to be meaningful to people who have run into it. I don't think there's a place to go where the error codes are explained -- although there might be.
    Ask your client what the complete message was.
    Also, have her hold down Command and choose About InDesign from the InDesign menu. She should see something like:
    Adobe InDesign Version CS3(5.0.3.662)
    immediately under Application Info. Compare what she has with what yours says.
    Dave

  • When I attempt to open a PDF file I saved from a website, I get the message "There was an error opening this document. The file is damaged and could not be repaired." Is there any way to correct this problem?

    When I attempt to open a PDF file I saved from a website using Safari, I get the message "There was an error opening this document. The file is damaged and could not be repaired." When I save the same PDF file using FireFox it opens up immediately. Is there any way to correct this problem with Safari?

    Back up all data.
    Triple-click the line of text below to select it, the copy the selected text to the Clipboard (command-C):
    /Library/Internet Plug-ins
    In the Finder, select
    Go ▹ Go to Folder
    from the menu bar, or press the key combination shift-command-G. Paste into the text box that opens (command-V), then press return.
    From the folder that opens, remove any items that have the letters “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari, and test.
    The "Silverlight" web plugin distributed by Microsoft can also interfere with PDF display in Safari, so you may need to remove it as well, if it's present.
    If you still have the issue, repeat with this line:
    ~/Library/Internet Plug-ins
    If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari again.

  • Error message in .docx : 'Open XML file cannot be opened because there are problems with the contents. Details Unspecific error Location: 2'

    I have put a lot of work into a docx document on my Mac, but now can't open it as it gives the error message: 'the Open XML file cannot be opened because there are problems with the contents. Details, Unspecific
    error, Location: 2'
    When opening the original file the message said: 'this file contains word 2007 for Windows equations' etc. but I managed to track changes fine, and saved, closed and re-opened it numerous times without problem. Some graphs seemed moved, and various formulas
    were illegible, but no other weirdness was observed.
    I have microsoft 2008 installed on my Mac OS X version 10.6.8.
    I've tried to fix it using various solutions suggested here, but am afraid am too IT illiterate to have had any luck, please help I'm new to all this!
    I've uploaded it to https://www.dropbox.com/s/hkw9k6lyihzoxpc/SittwayPauktawSQUEACREPORT_KD%2BCH.docx

    Hi,
    This issue is related strictly to oMath tags and occurs when a graphical object or text box is anchored to the same paragraph that contains the equation.
    Please use the "Fix it" tool in the following KB article to resolve the problem. See:
    http://support.microsoft.com/kb/2528942
    Hope this helps.
    Regards,
    Steve Fan
    TechNet Community Support

  • Went to open a file in words and got message. "You need a newer version of Pages to open this document." I have latest version.  All other files open w/o a problem.  Please help.

    Went to open a file in words and got message. "You need a newer version of Pages to open this document." I have latest version.  All other files in words open w/o a problem.  Please help.
    Thank you.
    <Email Edited by Host>

    You have 2 versions of Pages on your Mac.
    Pages 5.2 is in your Applications folder.
    Pages '09/'08 is in your Applications/iWork folder.
    You are alternately opening the wrong versions.
    Pages '09/'08 can not open Pages 5 files and you will get the warning that you need a newer version.
    Pages 5.2 can open Pages '09 files but may damage/alter them. It can not open Pages '08 files at all.
    Older versions of Pages 5 can not open files from later versions of Pages 5.
    Once opened and saved in Pages 5 the Pages '09 files can not be opened in Pages '09.
    Anything that is saved to iCloud and opened in a newer version of Pages is also converted to Pages 5 files.
    All Pages files no matter what version and incompatibility have the same extension .pages.
    Pages 5 files are now only compatible with themselves on a very restricted set of hardware, software and Operating Systems and will not transfer correctly on any other server software than iCloud.
    Apple has removed almost 100 features from Pages 5 and added many bugs:
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&sid=3527487677f0c 6fa05b6297cd00f8eb9&mforum=iworktipsntrick
    Peter

  • Have been using Lightroom on my Apple computer for years. Now, ever since upgrading to Apple's  Yosemite operating system I get an error message (150:30) every time I try to open a lightroom file. Has anyone else experienced this problem?  Also how do I s

    Have been using Lightroom on my Apple computer for years. Now, ever since upgrading to Apple's  Yosemite operating system I get an error message (150:30) every time I try to open a lightroom file. Has anyone else experienced this problem?  Also how do I subscribe to Adobe's Premium Support? Every time I've tried (through contact support) I just get taken on an unending loop.

    I think we need a lot more information.
    Exactly what does the message say?
    Exactly what files are you trying to open?
    Exactly how are you trying to open them (what menu command or button or mouse action or keyboard shortcut)?
    And lastly, what version of Lightroom are you using?

  • The file .docx cannot be opened because there are problems with the contents in sharepoint document library

    I created a site and  created a document libarary and assigned a word document as a content type . I have written a workflow to create a new document . The workflow is working fine and all the document is getting created and values are getting stored
    in it .
    As per my requirement I am saving the above site as site template .
    After that I am creating a new site based on the above site template , Its getting created and I started the workflow , its working fine and the document is also getting created .
    The problem is I am getting error while opening the word document
    Error - The file filename.docx cannot be opened because there are problems with the contents .
    Details - No error details availble .
    Indresh

    What are you doing within the txt document?  Is it general text and string based items, or have you something more elaborate going on?
    An older discussion here elaborates a bit more on the dotx vs docx side of things.
    http://social.msdn.microsoft.com/Forums/en-US/de1b5ff9-ea6d-460c-a707-8c28acd4906f/error-opening-office-open-xml-file-when-using-sd-workflow-to-create-item-in-document-library?forum=sharepointcustomizationlegacy
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • On photoshop element 12 when I open a .MTS file I have the sound with a black screen if I open a .mov it work fine I have uninstall and reinstall I still have the same problem can you help?

    On photoshop element 12 when I open a .MTS file I have the sound with a black screen if I open a .mov it work fine I have uninstall and reinstall I still have the same problem can you help?

    I have find the codec installed on my PC do you see an undesirable one I have highlighted the one that seems strange should I uninstall how can I do this safely
    Daniel
    Codecs audio
    Type
    Nom
    Format
    Binaire
    Version
    ACM
    Codec Microsoft IMA ADPCM
    0011
    ACM
    CODEC A-Law et u-Law Microsoft CCITT G.711
    0007
    ACM
    Codec audio Microsoft GSM 6.10
    0031
    ACM
    Codec Microsoft ADPCM
    0002
    ACM
    Fraunhofer IIS MPEG Layer-3 Codec (decode only)
    0055
    ACM
    Convertisseur PCM Microsoft
    0001
    DMO
    WMAudio Decoder DMO
    0160, 0161, 0162, 0163
    WMADMOD.DLL
    6.1.7601.17514
    DMO
    WMAPro over S/PDIF DMO
    0162
    WMADMOD.DLL
    6.1.7601.17514
    DMO
    WMSpeech Decoder DMO
    000A, 000B
    WMSPDMOD.DLL
    6.1.7601.17514
    DMO
    MP3 Decoder DMO
    0055
    mp3dmod.dll
    6.1.7600.16385
    Codecs vidéo
    Type
    Nom
    Format
    Binaire
    Version
    ICM
    Microsoft RLE
    MRLE
    msrle32.dll
    6.1.7601.17514
    ICM
    Microsoft Vidéo 1
    MSVC
    msvidc32.dll
    6.1.7601.17514
    ICM
    Microsoft YUV
    UYVY
    msyuv.dll
    6.1.7601.17514
    ICM
    Codec Intel IYUV
    IYUV
    iyuv_32.dll
    6.1.7601.17514
    ICM
    Toshiba YUV Codec
    Y411
    tsbyuv.dll
    6.1.7601.17514
    ICM
    Codec Cinepak de Radius
    cvid
    iccvid.dll
    1.10.0.13
    DMO
    Mpeg4s Decoder DMO
    mp4s, MP4S, m4s2, M4S2, MP4V, mp4v, XVID, xvid, DIVX, DX50
    mp4sdecd.dll
    6.1.7600.16385
    DMO
    WMV Screen decoder DMO
    MSS1, MSS2
    wmvsdecd.dll
    6.1.7601.17514
    DMO
    WMVideo Decoder DMO
    WMV1, WMV2, WMV3, WMVA, WVC1, WMVP, WVP2
    wmvdecod.dll
    6.1.7601.18221
    DMO
    Mpeg43 Decoder DMO
    mp43, MP43
    mp43decd.dll
    6.1.7600.16385
    DMO
    Mpeg4 Decoder DMO
    MPG4, mpg4, mp42, MP42
    mpg4decd.dll
    6.1.7600.16385
    De : sarika02 
    Envoyé : 17 juin 2014 19:26
    À : Daniel Cloutier
    Objet :  On photoshop element 12 when I open a .MTS file I have the sound with a black screen if I open a .mov it work fine I have uninstall and reinstall I still have the same problem can you help?
    On photoshop element 12 when I open a .MTS file I have the sound with a black screen if I open a .mov it work fine I have uninstall and reinstall I still have the same problem can you help?
    created by sarika02 <https://forums.adobe.com/people/sarika02>  in Photoshop Elements - View the full discussion <https://forums.adobe.com/message/6466796#6466796>

  • Opening a text file in server from an applet running in the client

    Friends,
    I want to open a text file in the server(The server machine uses tomcat 4.1.12 server)from an applet running in the client machine;
    The applet invokes a servlet that opens the text file;this text file is opened in the server machine; but I want it to be opened in the client machine where the applet is running.
    Plese help me to get around this.

    You can open the textfile on the servlet and then send the information to the client (applet) as stirngs. The must then applet convert the stirngs into some object or simply display the information in someway. But then the text file that you are opening must be stored in some relevant tomcat directory e.g. on the server. If you want to open a file on the clients computer, you get into signed applets.

  • Problems opening InDesign CS4 files in CS5

    We have just upgraded to CS5 to take advantage of the tracked changes facility, and immediately encountered problems:
    when opening CS4 files in CS5, we've noticed that formulae, created using charater styles, are not displaying properly.  For example x = y / z, which would have the x and = signs dropped, the y underlined and the z on the next line, something like this (although much prettier than I can reproduce here):
    x = y
          z
    in CS5, however, all gyphs in the formula are superimposed upon each other
    we tried loading the character styles from our template document.  However, that caused most of the content to dissapear!
    we tried converting our template to CS5 and then loading the character styles from our template document.  However, that also caused most of the content to dissapear!
    Anybody got any clues?

    troglodytes2000 wrote:
    We have just upgraded to CS5 to take advantage of the tracked changes facility, and immediately encountered problems:
    when opening CS4 files in CS5, we've noticed that formulae, created using charater styles, are not displaying properly.  For example x = y / z, which would have the x and = signs dropped, the y underlined and the z on the next line, something like this (although much prettier than I can reproduce here):
    x = y
          z
    in CS5, however, all gyphs in the formula are superimposed upon each other
    we tried loading the character styles from our template document.  However, that caused most of the content to dissapear!
    we tried converting our template to CS5 and then loading the character styles from our template document.  However, that also caused most of the content to dissapear!
    Anybody got any clues?
    If you are opening the CS4 files directly in CS5, try exporting CS4 files to IDML and opening the IDML files in CS5. It's worth a try if you haven't already found it doesn't help.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

Maybe you are looking for

  • HP Laserjet Pro MFP M125A " A Fatal Error Occured Preventing Product Use" on Window XP SP3

    Dear Friends, I really need your help on this issues, recently company that i been working buy 19 Unit of HP Laserjet Pro MFP M125A printer to be install at our 19 branches. All of our branches is using Window XP SP3 and the spec is exceed the minimu

  • BW Statistics 3.5

    Hi all,          RSA1 t-code top displaying Data warehouse workbench and System component version is SAP NetWeaver 2004s, but all objects developed in 3.5 data flow. My doubt now i going to install BI Statistics whether i have to install below IC als

  • FTP Validation help, please...

    When I go to upload to my FTP host (see image): I get this warning box: The "Why am I getting this error?" link takes me to a generic FTP page with no specific answer to the question. Please help. Thank you.

  • Getting ORA -01427 for an update query

    Hi, I have two tables Create table tran tran_id varchar(5) primary key, stat varchar(6), stat_ts timestamp); create table tran_hist hist_id number(5) primary key, tran_id varchar(5) , stat varchar(6), stat_ts timestamp); insert into tran values('abc'

  • I am unable to print on a printable DVD even though there is a printable CD/DVD facility.

    I am using an HP Photosmart C5280 All-in-One printer with a print to a printable CD/DVD option. However although I have downloaded the software to run the printer I have not got the option to print to a CD/DVD. Is there a software download which will