Copy a .swf file from server side to client using signed applet

Hello All,
I already have my applet signed and its working pretty well. However I want to know how can I import a .swf file into clients machine. The .swf file initially is on server side, my applet checks whether this .swf file exists already on client machine. If not it copies it to his machine.
I know how to chk if the file already exits on client machine but I am not sure how to copy this .swf file to his machine if its missing.
May be I need to set some input buffers from server side and then copy them to his machine.
Can some one throw some light on this issue ??

Hello to all Java Code Masters out thr,
I am trying to copy a .swf file from server side to client side, however I am unsuccessful in writing the correct data. By correct data I mean that , the data does gets saved on the client side in the .swf file, and the size of the .swf file on client side is as expected, but some how I don't know why the data is not the same as expected.
I tried opening up both the swf file, one which is on server side and the other which is on client side. And both looked different in the notepad.
When I opens up the client side .swf file on browser it shows nothing while the .swf file on server side worked fine.
Here is a snap shot of the two .swf files when opened in notepad:
clientside.swf
坃ࡓ죃鱸뷤瀉�ᡚ穸s歒斷뛉쭬ⶲ뉯緤░뉋쭬틲��毳띵뺤畮祮୹釯烉쉍‼➀Ƿℵ㼤ꦅ㼌⡉⁈ș㖩䈼ꦓɊጵꨘ妆ၸ쇠鳳ﯯ龜괯䪅�쿾칿칷컹緶履殖㋿罣쯻杬�懨�E�翂䶙幷鿠︡拡ﬦ댨꾖政ᯋὣꯤ糥䧩缿䨗捫嶺깼瘶羋⯞勹쪾癞ঞ頁韧୘롻ⱖ撯貊攗閩㫙↳萰Ⳁ⼈쳂荡᧰ﻶ顠꓈鸎싔㿄㰧柂䪄러䂀좹㏠ꕊ㌏힟䘜㦴⌙⍈㽾ꙴ㿯렑㽔serverside.swf
CWS�� x���     p��ZxzS�Rk�e��l��-o��}�%K�l�������]��ku���nu��nyy���pM�< �'�5!$����I
(H �
5<B
��J5��Yx��������/����J������w����}���
k�2c��lg���a��\�%��serverside.swf is what I expect to be saved, but clientside.swf is what i get.
Below is a code snippet which I am trying :
  public void writeswftoclient(String swfcontent) {
    String userHome = System.getProperty("user.home" );
    String ImoracleDirectory = userHome + "\\MyFolder";
    File fdirectory = new File(ImoracleDirectory);
    if(!fdirectory.isDirectory()) {
      fdirectory.mkdir();
    String playlist = ImoracleDirectory + "\\clientside.swf";
    File fplaylist = new File(playlist);
    try {
      Writer output = null;
      output = new BufferedWriter(new FileWriter(fplaylist,true));
      *System.out.println(swfcontent);*
      *output.write(swfcontent);*
      output.close();
    catch (Exception e) {
      System.out.println("Cannot create or write to the playlist");
  }In above code I am trying to write the string swfcontent, which contains the data shown above in serverside.swf, to clientside.swf.
Interesting thing is that I am doing System.out.println(swfcontent); just before writing the data to clientside.swf using output.write(swfcontent);. And System.out.println does print the write data on the java console. However I dont know out of what reason the data doesnt get written correctly on the client's computer.
Kindly help me in this plzzzzzzzzzz.

Similar Messages

  • How to download a file from server machine to client machine using jsp

    Hi,
    In my application, I have an excel file stored on my server machine. How can I download that excel file on to my client machine using jsp. Is there any other way I can open that file from my machine and save it in my machine using jsp/java?
    Its an emergency for me to do this.
    Can anyone provide me the full code to download a file from server machine as I don't have
    time to browse through various sites.
    thanks in advance,
    Tiijnar

    Please post your code using code tags (click on CODE above the text area, when posting)
    response.setContentType("application/octet-stream");Why octet-stream? Set the correct mime-type.
    String disHeader = "Attachment; Filename=\"filename\"";The filename should just be the file's name. Not the complete path to the file! This will tell anyone where the file is located on the server. It's also inconvenient because by default,the browser will suggest it as the name for the download.
    Your way of writing to the output stream is just plain wrong. See this snippet (picked from [http://balusc.blogspot.com/2007/07/fileservlet.html])
            BufferedInputStream input = null;
            BufferedOutputStream output = null;
            try {
                // Open streams.
                input = new BufferedInputStream(new FileInputStream(file), DEFAULT_BUFFER_SIZE);
                output = new BufferedOutputStream(response.getOutputStream(), DEFAULT_BUFFER_SIZE);
                // Write file contents to response.
                byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
                int length;
                while ((length = input.read(buffer)) > 0) {
                    output.write(buffer, 0, length);
                // Finalize task.
                output.flush();
            } finally {
                // Gently close streams.
                close(output);
                close(input);
            }

  • How to send Subtopic Message From Server-Side to Client ?

    I’m new at flex and i have a new question about Flex
    Message Service.
    How to send messages from Server-Side Java Code with
    Subtopic?
    For example.
    I customed a Flex Message Adapter in Tomcat Server , with
    this Adapter , i can send message to Client with following code .
    ---------------------Send message to Client------------
    MessageBroker msgBroker =
    MessageBroker.getMessageBroker(null);
    String clientID = UUIDUtils.createUUID(false);
    AsyncMessage msg = new AsyncMessage();
    msg.setDestination("CustomMsgServiceDes");
    msg.setClientId(clientID);
    msg.setMessageId(UUIDUtils.createUUID(false));
    msg.setTimestamp(System.currentTimeMillis());
    msg.setBody(clientID + "this is my message from server! \n");
    msgBroker.routeMessageToService(msg, null);
    ---------------------Send message to Client------------
    But i want send a message that have Subtopic to the Client ,
    How to do ?
    Thank you for reply.

    There's a white paper that talks about this subject -
    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=8f1eb6ea

  • Copy a file from server to the client - URLConnection to a Portal page

    Hello:
    I have an application running on the client side. When the app startup it must open a file which is at the server side, to be more specific, the file is at KM content of the portal.
    I try to read it with URLConnection to copy the file from the server to the client, the app will do it, but "Server returned HTTP response code: 401 for URL:"
    If you copy&paste the url's file directly on the browser (http://host:port/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/ImagenesIM/file.txt) a login popup (look and feel windows) is display. After entering the user and psw the file is open without problem.
    Any idea what can I use or how do it ?.
    I think that probably I have to move the app to a was directory instead of portal directory.
    The app is execute via *.jnlp with a link at a portal page.
    Thanks a lot for your time.

    Javier,
    401 means authentication error, i.e. your application is not authenticated to KM.
    What you can do? Actually, it depends. Check current cookies in your application, probably there are SSO coockie or J2EE authentication cookie. You may try to set this cookies in URLConnection (via addHeader). Otherwise you have to supply authentication creadentials to URLConnection (also via addHeader, most probably, via Basic HTTP authentication scheme).
    Valery Silaev
    EPAM Systems
    http://www.NetWeaverTeam.com

  • Accessing server side EJB directly using remote applet

    Hello, I have some EJB's running on a sun app server and would like them to be invoked directly, if possible, by a remote applet (obviously it would be delivered from my app server). At the moment I am simply testing them using an application client returned by Deploytool.
    I am wondering how difficult this will be, particularly how the applet would look up the beans (is the Context setup similar etc.?) and whether there is a huge difference between the applet code and the app client I have been using.

    I suspected that was the issue - no way for the local system to know when to route to VPN or local.
    Problem with changing the network ranges is often the client network is not something I control - 'client' offices, wireless hotspots, hotels, etc.
    Changing the server network while not impossible would be difficult as everything from printers, servers, network switches, not to mention how X Server so easily allows changing it's primary IP, are effected.
    I can certain test that this is my only problem by reconfig'g my home setup.
    I'm guessing a simpler and more flexible option in my case is creating a 10.0.2.x (VPN only) network internally adding an alias IPs to my XServe and other servers/boxes I would need to access from VPN (which would dish out 10.0.2 client numbers instad of 10.0.1 numbers). The only tricky part is name resolution, but since I control the DNS server and search names handed to the client, I could create a vpn.ourdomain.com and that could be the primary search domain, where all the records for VPN resources would return their 10.0.2.x. Client systems would/should be referencing resources by short name (hp8150).
    Does that make sense - a VPN network on top the existing server network?
    XServe Dual G4

  • Reading a XML File from server in BI Publisher

    Hi All,
    Can any one help me how i can get the XML file from server to BI Publisher using data source.
    The file should transfer directly to BI Publisher with out storing it in any local directory in local system.
    Thank you
    Shalini.

    Shalini
    Do you mean that you have another system that is going to serve up the XML data and you want BIP to be able to pick it up as a data source ?
    Couple of options:
    1, If the XML filename can remain static you can use the 'XML File' datasource. You need to set up a directory on the server and then maybe create a dummy XML file to start with upon which you can build a report. Then have your external data generator put the file into that directory and then schedule the report so that BIP will pick and report.
    2. IS the data generator accessible via HTTP or web service - BIP supports those too.
    3. More complex but with a little effort you can create a servlet that will pick up the file from a directory and serve it up to BIP on demand - Im going to write about this on the blog this week
    Regards
    Tim

  • Reading XML file from server in BI Publisher

    Hi All,
    Can any one help me how i can get the XML file from server to BI Publisher using data source.
    The file should transfer directly to BI Publisher with out storing it in any local directory in local system.
    Thank you
    Shalini.

    Shalini
    Do you mean that you have another system that is going to serve up the XML data and you want BIP to be able to pick it up as a data source ?
    Couple of options:
    1, If the XML filename can remain static you can use the 'XML File' datasource. You need to set up a directory on the server and then maybe create a dummy XML file to start with upon which you can build a report. Then have your external data generator put the file into that directory and then schedule the report so that BIP will pick and report.
    2. IS the data generator accessible via HTTP or web service - BIP supports those too.
    3. More complex but with a little effort you can create a servlet that will pick up the file from a directory and serve it up to BIP on demand - Im going to write about this on the blog this week
    Regards
    Tim

  • Drive Redirection virtual channel hangs when copying a file from server to client over RDP 8.1

    Problem Summary:
    A UTF-8 without BOM Web RoE XML file output from a line of business application will not drag and drop copy nor copy/paste from a Server 2012 R2 RD Session Host running RD Gateway to a Windows 7 Remote Desktop client over an RDP 8.1 connection and the Drive
    Redirection virtual channel hangs.  The same issue affects a test client/server with only Remote Desktop enabled on the server.
    Other files copy with no issue.  See below for more info.
    Environment:
    Server 2012 R2 Standard v6.3.9600 Build 9600
    the production server runs RDS Session Host and RD Gateway roles (on the same server).  BUT,
    the issue can be reproduced on a test machine running this OS with simply Remote Desktop enabled for Remote Administration
    Windows 7 Pro w SP1v6.1.7601 SP1 Build 7601 running updates to support RDP 8.1
    More Information:
    -the file is a UTF-8 w/o BOM (Byte Order Marker) file containing XML data and has a .BLK extension.  It is a Web Record of Employment (RoE) data file exported from the Maestro accounting application.
    -the XML file that does not copy does successfully validate against CRA's validation XML Schema for Web RoE files
    -Video redirection is NOT AFFECTED and continues to work
    -the Drive Redirection virtual channel can be re-established by disconnecting/reconnecting
    -when the copy fails, a file is created on the client and is a similar size to the original.  However, the contents are incomplete.  The file appears blank but CTRL-A shows whitespace
    -we can copy the contents into a file created with Notepad and then that file, which used to copy, will then NOT copy
    -the issue affects another Server 2012 R2 test installation, not just the production server
    -it also affects other client Win7 Pro systems against affected server
    -the issue is uni-directional i.e. copy fails server to client but succeeds client to server
    -I don't notice any event log entries at the time I attempt to copy the file.
    What DOES WORK
    -downgrading to RDP 7.1 on the client WORKS
    -modifying the file > 2 characters -- either changing existing characters or adding characters (CRLFs) WORKS
    -compressing the file WORKS e.g. to a ZIP file
    -copying OTHER files of smaller, same, and larger sizes WORKS
    What DOES NOT WORK?
    -changing the name and/or extension does not work
    -copying and pasting affected content into a text file that used to have different content and did copy before, then does not work
    -Disabling SMB3 and SMB2 does not work
    -modifying TCP auto-tuning does not work
    -disabling WinFW on both client and server does not work
    As noted above, if I modify the affected file to sanitize it's contents, it will work, so it's not much help.  I'm going to try to get a sample file exported that I can upload since I can't give you the original.
    Your help is greatly appreciated!
    Thanks.
    Kevin

    Hi Dharmesh,
    Thanks for your reply!
    The issue does seem to affect multiple users.  I'm not fully clear on whether it's multiple users and the same employee's file, but I suspect so.
    The issue happens with a specific XML file and I've since determined that it seems to affect the exported RoE XML file for one employee (record?) in the software.  Other employees appear to work.
    The biggest issue is that there's limited support from the vendor in this scenario.  Their app is supported on 2012 R2 RDS.
    What I can't quite wrap my head around are
    why does it work in RDP 7.1 but not 8.1?  What differences between the two for drive redirection would have it work in 7.1 and not 8.1?
    when I examine the affected file, it really doesn't appear any different than one that works.  I used Notepad++ and it shows the encoding as the same and there doesn't appear to be any invalid characters in the affected file.  I wondered
    if there was some string of characters that was being misinterpreted by RDP or some other operation and blocked somehow but besides having disabled AV and firewall software on both ends, I'm not sure what else I could change to test that further
    Since it seems to affect only the one employee's XML file AND since modifying that file to change details in order to post it online would then make that file able to be copied, it seems I won't be able to post a sample.  Too bad.
    Kevin

  • How to copy file from server to another machine in network through JSP

    Hello!
    any body can solve my problem.
    i m working in JSP. i want to copy a file from server on which JSP engine is running to another computer in the same network.
    i used Java File Object to copy file from one machine to another in network. and its working fine on network. but the problem is when i used the same code in web page there is exception which is Access is Denied. what i should do now.
    i m writing the code i m using in my JSP page
    String fileToCopy = "C:/oracle/Apache/Apache/htdocs/FAO/FAO_MiddleFrame.jsp";
         String destinationDir = "\\\\af09\\c";
    File source = new File(fileToCopy);
    String fileName1 = source.getName();
    if ((!destinationDir.endsWith("\\")) && (!destinationDir.endsWith("/"))) {
    destinationDir = destinationDir + "\\";
    File destination = new File(destinationDir + fileName1);
    if (!destination.exists()) {
    if (!destination.createNewFile()) {
    //throw new IOException("Unable to create file. May be you don't have permissions.");
    byte[] buffer = new byte[1024];
    FileInputStream in = new FileInputStream(source);
    FileOutputStream outStream = new FileOutputStream(destination);
    int bytesRead = 0;
    while ((bytesRead = in.read(buffer)) != -1) {
    outStream.write(buffer, 0, bytesRead);
    out.println("File copied successfully ....");
    plz reply me as soon as possible.
    i will be very thankful
    Saad

    Thats the way it works. Cause servlet contaner doesnot allow other machines in the network to access other than machine which it came from as in case of applets. What you can do is if the other machine is also based on webserver or app server .. you can upload the file as it gets to that page do the process.
    I would like to hear more on my comments..
    Suggestions ??
    Ban

  • How do I copy and paste files from a windows remote server to my mac?

    How can i copy and paste files from a remote server (windows) to my mac? i have installed cord to connect to the server but now i can´t cpy the files to my mac!

    Hi Sara.  Tanks for responding.  If I cannot figure this out (I  was up
    until 2am last night), I want to cancel my subscription.
    Here are two files you can check on/help me with.  When I try again,  it
    comes up 'an error has occurred when trying to access the service.'
    Please advise.
    Pat Tomassi
    In a message dated 11/1/2014 12:55:23 A.M. Eastern Daylight Time, 
    [email protected] writes:
    How  do I copy and paste text from a converted Word document?
    created by Sara.Forsberg (https://forums.adobe.com/people/Sara.Forsberg) 
    in Adobe Acrobat.com Services - View the full  discussion
    (https://forums.adobe.com/message/6888908#6888908)

  • How to make html file on server side from the data entered in text area

    Hi!
    I want to know how to make .html file on server side. Like if i enter the data in text area ( or like we normaly see when we write mail that editor) and we can use html tages in it and when user submit form all the data in that field will be saved on server side as an html formate. Is it possible to do so??? or any ruff idea how to design it???

    Erm ...
    Whats the problem with that?!
    Ok, here the code ...
    String myparameter = request.getParameter("paramname");
    String htmltemplate = "<html>\n"
                         +"<head><title>demo</title></head>\n";
                         +"<body>@parametertag@</body>\n";
                         +"<html>";
    String htmlpage = htmltemplate.replaceAll("@parametertag@",myparameter);
    File yourHTMLfile = new File("wheredoyouwannagotoday.html");
    FileOutputStream fos = new FileOutputStream(yourHTMLfile);
    fos.write(htmlpage.getBytes());
    fos.close();You're done.
    Happy Coding! :-) &copy;

  • Out of disk space when copying files from server to server

    Servers: NW 5.1.7
    Workstation: Windows 98SE with client32 v3.4
    There is a batch file that copies files from server A to server B. At certain point, the copying gets stuck and message is displayed on the workstation: ""Network Status. Client32: out of disk space writing file to server B." Unless I press OK, the copying will not continue. There's plenty of space and memory, no quotes or user restrictions on server B. This procedure worked for years without any problem and nothing was altered on the servers or workstation at time of occurrence.

    Did you purge the volumes ?
    How high is ratio between compressed and noncompressed data on volumes?
    I assume, that for this usage (copy one server to another) you should
    seek the different way (program), which transfer the compressed data
    with untouched state of compression.
    Jindrich Kovar
    Marty Fox napsal(a):
    > Servers: NW 5.1.7
    > Workstation: Windows 98SE with client32 v3.4
    > There is a batch file that copies files from server A to server B. At certain point, the copying gets stuck and message is displayed on the workstation: ""Network Status. Client32: out of disk space writing file to server B." Unless I press OK, the copying will not continue. There's plenty of space and memory, no quotes or user restrictions on server B. This procedure worked for years without any problem and nothing was altered on the servers or workstation at time of occurrence.

  • First boot copy files from server

    My computers set themselves up from a netboot image (i know, i'm still using monolithic imaging, but plan to learn deploy studio, I swear).
    Anyway, it would help me a ton if I could figure out how to have my first boot script copy some directories off the server onto the client, but i'm not sure how to build that command.  Can anyone help point me in the right direction?

    It's might be easiest inside an action in Deploy Studio - it configures a startup script to do tasks for you after the image is restored, then it cleans the scripts up & reports success to the server. There is no problem with using monolithic images with Deploy Studio either (last time I checked).
    Otherwise make a launchd job that runs your own script. Make the job delete the script and launchd plist on completion.
    You need to take into account any authentication on the server (don't leave passwords in plaintext) - I assume these files are not on a public/ guest share? Work out how to handle failures so you know which machines need attention. curl or scp could work from shell scripts. Copy it to the image before any deployment is done.
    See what others say, but I think Deploy Studio may be worth learning. Apple's System Image Utility had features for doing this too, but Deploy Studio seemed better to me.

  • How can i transfer more than one file from server to client

    Hi,
    our requirement is transfer more than one files from server to client using the
    webutil_file_transfer.as_to_client_with_progress.One file transfer is already working in our system.If anybody know the solution please inform
    regards
    mat

    just an idea ...
    for this purpose let us put aside security concerns and other potential problems....
    -- Get the content of a server directory with Filter and create zip file
    1) create a class that implements java.io.FilenameFilter ...
    2) define accept() method ...
    3) call File.list() with the filter as a parameter. The returned array of strings will have all the names that passed through the accept() filter
    4) use java.util.Zip to create ZIP file on the server side
    -- I think it is better to create this functionality as a separate Java class, put it in required folder and after it
    -- use Forms->Program->"Import Java class" to create pl/sql wrappers, than to create wrappers for all classes and code in pl/sql
    5) use webutil to transfer file on the client
    6) use Java on client side to unzip transferred file
    if you think this is not too complicated, you should try ...
    Regards,
    Vladimir

  • Loading local swf files from Application Dir (ios)

    Hi Guys,
    I would like to load additional local swf files to my ios release build but I am confused a little bit because of the new API changes.
    As far as I know at the moment (from Air 3.7 or newer) it is allowed to load local swf files that contains compiled actionscript both from local folder and from a predefined remote host as well. 
    My assumption based on this article:
    http://blogs.adobe.com/airodynamics/2013/03/08/external-hosting-of-secondary-swfs-for-air- apps-on-ios/
    I created the text file to include all of my local swf file names and created the following node in the application.xml:
    <iPhone>
           <externalSwfs>assets/SampleSWFInfoFile.txt</externalSwfs>
    </iPhone>
    When I compile the release build (ipa) using command line adt, it converts all of my local swfs into the stripped swfs which is perfect, but even though I include all the swfs in the compiler command, it puts only the SampleSWFInfoFile.txt file into the assets folder in the ipa but not the swf files.
    I assume, it thinks I will load these files from an external host, but I would like to include them in the app itself.
    I tried to copy the stripped swf files from the externalStrippedSwfs folder and comment the <externalSwfs>assets/SampleSWFInfoFile.txt</externalSwfs> node in the application.xml and compile it and this way it puts the swf files into the ipa, but when I try to install and launch the app it crashes and when I test it using Flash Builder it shows an error message
    "VerifyError: Error #1042: Not an ABC file."
    Do any of you guys know the  solution for this problem?
    Thank you for your help in advance!

    You're publishing in AOT mode as long as you use one of these:
    The AIR Developer Tool or ADT has targets that lets you package apps either for the AOT mode or Interpreter mode. The targets for packaging in AOT mode are ipa-app-store, ipa-ad-hoc, ipa-test and ipa-debug.
    Flash Pro CS6 and Flash Builder automate this process pretty well so it's invisible but the SWF loads and executes code just fine for me when directly published.
    If I take it to command line I can use this to compile successfully (iPad test app):
    adt -package -target ipa-ad-hoc -storetype pkcs12 -keystore my.p12 -provisioning-profile my.mobileprovision NameOfApp.ipa NameOfApp-app.xml NameOfApp.swf iTunesArtwork iTunesArtwork@2x AppIconsForPublish swfs/swfs.txt swfs/GenerateText.swf
    I at least include generic icons in there but I made a 'swfs' folder and placed 'swfs.txt' and 'GenerateText.swf' in there. The SWF uses code to randomly generate text and changes every second using a Timer. I load it in using the same code you do with the ApplicationDomain.currentDomain context. I see the SWF appear and text start randomly changing.
    As I compile there's a folder generated called 'externalStrippedSwfs' with the stripped SWF in there.
    One thing to note is I do not supply <externalSwfs>swfs/swfs.txt</externalSwfs> in my iPhone settings. If I do that it doesn't work. I supply the path to the text file containing the SWF I want to be stripped to adt itself along with the SWFs I want stripped and it takes care of the rest.

Maybe you are looking for

  • HELP ! Need to change video size in project sequence...

    When creating a project last month I accidently created it as 1280x960 in the sequence settings, but meant to create it as a 1920x1080 which is what all the video clips are in size. Now I have this nicely edited project but need to convert it to a 19

  • Zero byte files not transferred with FTP Adapter

    All, I am seeing that zero byte files are not being transferred using FTP Adapter (SFTP type). Is there a known bug around this? Please respond if anybody have seen this behavior and resolved this issue. I am using 10.1.3.3.0 Thanks, Dipal

  • New iMac 20 500Gb won´t start

    I got my new iMac iSight 20" today. With the wireless keyboard and mouse and the 500Gb hd option. Great - if it would start. First time I switched it on, I heard the Apple-sound, then the screen turned gray and showed the apple-logo. Forever. At leas

  • Ae-Won't open normally

    When I launch AeCC, a page with the Render Queue opens and nothing else. It is responing but it won't let me do anything.

  • WEB ADI issue on oracle e-biz 11.5.10.2

    Friends - We recently web ADI Patch - 6759191 including Pre-req patches. Users are getting following error when they are trying to downloading data to EXCEL. "java.lang.NullPointerException" How to find web ADI Version? Appreciate your support on thi