Files of zip type

Hi friends,
sender Legacy system is sending files in .Zip format.
how the adapter is going to process those files?
what configurations r to be needed in adapter configuration?
& also for processing of .pdf files what configurations should be done?
thanks in advance.
shiva.

Hi Shiva,
the adapter can process the file. At mapping time you need to dezip the msg. An example in java:
import java.io.*;
import java.util.Map;
import java.util.zip.*;
import com.sap.aii.mapping.api.StreamTransformation;
import com.sap.aii.mapping.api.StreamTransformationException;
public class DecompressMapping implements StreamTransformation {
     /* (non-Javadoc)
      * @see com.sap.aii.mapping.api.StreamTransformation#setParameter(java.util.Map)
     public void setParameter(Map arg0) {
          // TODO Auto-generated method stub
     /* (non-Javadoc)
      * @see com.sap.aii.mapping.api.StreamTransformation#execute(java.io.InputStream, java.io.OutputStream)
     public void execute(InputStream arg0, OutputStream arg1)
          throws StreamTransformationException {
               try {
          int len;
          byte[] buf = new byte[8192];
          boolean first_iter = true;
          ByteArrayOutputStream baos = new ByteArrayOutputStream();
          while((len = arg0.read(buf) ) != -1)
               if (first_iter)
                 if ((buf[0] != 'P') || (buf[1] != 'K'))
                      arg1.write(buf, 0, len);
                    while((len = arg0.read(buf) ) != -1)
                         arg1.write(buf, 0, len);                           
                      return;     
                 else
                      first_iter = false;
               baos.write(buf, 0, len);
          byte[] in_data = baos.toByteArray();
          ZipInputStream zis = new ZipInputStream(new ByteArrayInputStream(in_data));
               ZipEntry ze = zis.getNextEntry();
               if (ze != null)
                    while((len = zis.read(buf) ) != -1)
                         arg1.write(buf, 0, len);
          } catch (IOException e) {
               e.printStackTrace();
Regards,
Udo

Similar Messages

  • HT1338 I have a problem with opening downloaded files from the internet; zip types. Can you tell me an app to open these types of formats of files?

    I have a problem with opening downloaded files from the internet; zip types. Can you tell me an app to open these types of formats of files?

    It should unzip if you double-cick.
    What are you seeing happen when you do that?
    Select a .zip file in the Finder and Get Info (cmd-i). What is set for it to Open With. It should be Archive Utility.

  • Add .txt files into .zip file

    Hello friends,
    Any buddy knows how to add ".txt" files into ".zip" format through the ABAP code. 
    Thanks in advance.

    Hi Murali,
    You can use the method in the class CL_ABAP_GZIP to zip your file and then download it using GUI_DOWNLOAD.
    data: zip type ref to cl_abap_zip,
          result type xstring.
    create object zip.
    zip->add( name = some_file content = content ).
    result = zip->save( ).
    Also you can check this thread as well.
    How to Download data in Zip folder
    Re: UNZIP file from ABAP
    Hope this will help.
    Regards,
    Ferry Lianto
    Please reward points if helpful.

  • Java.util.zip.ZipFile.entries() shows only 99 files but zip file is fine.

    Hi,
    I have a wierd issue with java.util.zip.ZipFile
    Code as simple as
    ZipFile file = new ZipFile("my.zip") ;
    System.out.println(file.size());
    For this particular zip file, it says 99 files found but the zip contains more than 60,000 files. I tried the zip with unzip and zip utilities and the zip file checks out fine. I even tried to unzip the contents, and zip 'em up all over again, just to eliminate the chances of corruption while the zip was being transferred over the network.
    The same program works fine with another zip containing more or less the same number of files and prints 63730.
    Any idea? This can not possibly be related to the type of files the zips contain? right? In any case, the contents of both zips are text/xml files.
    Any help would be greatly appreciated.
    Regards,
    ZiroFrequency

    I know its a problem with this particular zip. But whats interesting is that "unzip" can easily open / verify the zip and claims that it is a valid zip.
    As I wrote earlier, I unzipped the file and zipped up the contents again in a new zip but java can't still count the contents correctly.
    So I am thinking there is something to do with the "contents" of the xmls inside the zip? (characterset issues?)
    There are no exceptions thrown and no error anywhere :(
    I basically need to pinpoint the issue so that I can have it corrected upstream as this zip file processing is an ongoing process and I need to resolve it not just once but for the periodic executions.
    Hope this helps explain the issue.

  • Converting html file into zip file and send email attaching zip file

    Hi Experts,
    I am trying to send email with attachment(html). Which contains more than 7MB. So, It is throwing an error like Size exceeded.
    So, Now i need to compress the data for less than 7MB.
    I decided to convert HTML File into ZIP File.
    Kindly suggest me to convert the HTML file into ZIP file and sending email with attached ZIP file.
    Correct answer rewarded,
    Thanks & Regards,
    N. HARISH KUMAR

    Hi Experts,
    *// HTML_TAB converting into ZIP File
       DATA  : zip_tool TYPE REF TO cl_abap_zip,
               filename TYPE string ,
               filename_zip TYPE string .
       DATA  : t_data_tab TYPE TABLE OF x255,
               bin_size TYPE i,
               buffer_x TYPE xstring,
               buffer_zip TYPE xstring.
    filename = text-007.                                                                          "'HTML_TAB
    *describe the attachment
       DESCRIBE TABLE html_tab LINES tab_lines.
       bin_size = tab_lines * 255.
       CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
         EXPORTING
           input_length = bin_size
         IMPORTING
           buffer       = buffer_x
         TABLES
           binary_tab   = html_tab.
       IF sy-subrc <> 0.
    *     message id sy-msgid type sy-msgty number sy-msgno
    *     with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ENDIF.
    *create zip tool
       CREATE OBJECT zip_tool.
    *add binary file
       CALL METHOD zip_tool->add
         EXPORTING
           name    = 'FSSAI_MAIL.HTML'
           content = buffer_x.
    *get binary ZIP file
       CALL METHOD zip_tool->save
         RECEIVING
           zip = buffer_zip.
       CLEAR: t_data_tab[],bin_size.
       CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
         EXPORTING
           buffer        = buffer_zip
         IMPORTING
           output_length = bin_size
         TABLES
           binary_tab    = html_tab.
    Thanks & Regards,
    N. HARISH KUMAR

  • Can not generate one xsd file  for message type in xi

    Dear Experts.
    I am not able to generate  one XSD file from  message type from XI 3.0, When i select message type and go to XSD tab  then click on export xsd to file, it is generating two xsd files MainSchema.xsd,  Schema1.xsd  into one zip file, but i need only one xsd file to import it into MDM.
    Could you please help
    Thanks and Regards.
    Sravya.
    The following are the two files. MainSchema.xsd,  Schema1.xsd .

    Hi Harsha,
    Thanks lot for the immediate response. Appreciate it.
    Now I am able to generate the one xsd with your inputs , but i am not able to load it into mdm with out any changes in the generated XSD from Message Type. the below is only the original root tag, where modification required.
    Original  Element : MDM_CUST_MASTER_FILE_REQUEST_MT
    ==============
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:abc.com:MDM_Customer_Master_ECC" targetNamespace="urn:abc.com:MDM_Customer_Master_ECC">
    <xsd:element name="MDM_CUST_MASTER_FILE_REQUEST_MT" type="MDM_CUST_MASTER_FILE_REQUEST_DT" />
    etc.
    Case :.When i modify the above element as below  with out xmlns, targetNamespace
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="MDM_CUST_MASTER_FILE_REQUEST_MT" type="MDM_CUST_MASTER_FILE_REQUEST_DT" />
    I can import xsd into mdm with the above modification.
    The generated XML out put File from mdm is having message type tag like below
    ?xml version="1.0" encoding="UTF-8"?>
    <MDM_CUST_MASTER_FILE_REQUEST_MT> 
    <CUSTOMER> </customer> ...
    note: no namespace for message type
    Result:
    1.When i send this xml file into XI it is failing in message mapping  because it doesn't have namespace attached to it and failing in message mapping.
    Finally i need your help to generate the xsd or data file like below to avoid mapping problem in xi.
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MDM_CUST_MASTER_FILE_REQUEST_MT xmlns:ns0=urn:abc.com:MDM_Customer_Master_ECC>
    Appreciate your help.
    Thanks and Regards.
    Sravya.

  • File Error: Wrong type

    Hi,
    I have been archiving some old finished videos (as self-contained QTs) on a server that is PC based. I have a feeling that this may be a problem. I'm right, right?
    On a related note, I now have some QTs that will not open, with error messages like
    'File Error: Wrong type.' (FCP)
    and
    'Error opening movie
    The movie could not be opened.' (QT)
    The fun part is that I cannot remember exactly which had been moved over there (I had a couple LaCies die on me and in a rush transfered a bunch of stuff back and forth trying to stay ahead of the crash), but now they're back on Mac based externals. But won't open.
    Any advice is tremendously appreciated.
    Thanks,
    Ariel.
    Dual 1.8 GHz PowerPC G5   Mac OS X (10.3.9)   1 LaCie Big Disk Extreme, 1 Maxtor 500Gb, FCPHD 4.5, QT Pro 7.1.3

    Okay, thanks for the help. I'm pretty swamped right now, but by next Monday I will have gone through all of them. I will post back then with any info that may be of interest.
    So, for the future, I should either stay away from non Mac OS formatted drives for my media, or zip them before sending them over. (by control clicking and archiving)
    (sigh) Thanks, guys. I'm still just trying to figure out the cheapest, quickest way to archive my old stuff. I guess tape is the best way to go.
    - Ariel.

  • Using wildcards (*) in sender file adapter - FTP type

    Hi guys!
    Dooes it work using wildcards in sender file adapter (FTP type(!) (filesystem obviously work))? I tried it and it failed. it works only for exact name..
    I read some articles about FTP and the result is, that ftp work always only with 1 file, so I'm wondering, if this is possible.
    Thanks for info!
    Olian

    Thanks for all replies..
    I know of course, that * can be used, I use it in many scenarios too. But on a FileSystem. It is not working if the sender type is FTP.
    *, ., *.dat, ...  nothing like that works..  Just exact file name.
    I am able to pick up file, if I specify it's exact name, so there should be no problem with permissions..
    Please, I'd appreciate one reply with comfirmation: yes, we are using asterisk (*) , we access source files via FTP and they are processed.
    Is there anybody with this experience, that it works?
    Thank you!
    Olian

  • Receiving an export file error: wrong type

    I have created a movie several times in FCP and then exported the movie to QT without any problems. Now all of a sudden, I can't get the movie to export correctly. After the 2 hour export, I'll check on FCP to find that the program has shut down without an "Unexpected Shut Down" message. I check for the exported movie which I find in the saved folder. I click to open and verify the completed job, but find that I get an error instead : "Error: Wrong Type".
    The last successful movie I created was September 14th, prior to the QT 7.5.5 upgrade. I thought it was the upgrade, as I found out that FCP does not do well with the new QT version, so I reverted to QT 7.5, but I am still experiencing the same problem with FCP quitting and the movie not being able to read.
    What is going on? Can anyone help?

    Francois:
    This is a crazy solution, but this happened to me last week and this solution enabled me to open my files again -- they were all greyed out and I thought I'd lost them. I took my drive in to an Apple Store Genius Bar without resolution and spend 2 hours online with ProApps (FCE/FCP) tech support, also with no resolution.
    This fix is based on the fact that FCP when it is started, it automatically opens the project that was open when it was closed. First, in FCP save the current project (this can be any project -- I created a placeholder project -- to a dummy name -- I used "save me". Close FCP and delete the dummy name ("save me") project. Now rename the project that is greyed out and provides the File Error: Wrong Type message that you would like to open to the dummy name, so that it's now called "save me". Now open FCP again. Now save the recuperated file using the original name.
    Maarten
    Here's what you do.

  • Creating an XLS file and Zip it

    Hi All,
    we have a requirement where in we have to create an XLS file from internal table. This xls file then has to be zipped and mailed.
    If anyone knows how to create an xls file and zip it in WebDynpro, without using OPEN, CLOSE DATA SET etc, Please let us know. It will be of great help.
    Thanks,
    Anand

    >2) Convert the STRING format to XSTRING format by using the FM SCMS_STRING_TO_XSTRING.
    Actually you should use CL_BCS_CONVERT=>STRING_TO_XSTRING now.
    >3) Use the method COMPRESS_BINARY of class CL_ABAP_GZIP to compress the XSTRING file.
    You probably want to use CL_ABAP_ZIP instead of CL_ABAP_GZIP.  CL_ABAP_GZIP only does compression, which is fine for storing a single packet of data in the database.  However CL_ABAP_ZIP is better suited for mult-part zip (multiple inner files).
    >4) Use the method SEND_WEB_MAIL of class CL_HRRCF_SERVICES_MAIL to mail across the zipped contents.
    This seems to be an HR specific class. Better to use the cross application, NetWeaver provided functionality for sending mail - CL_BCS.

  • Logon Error in importing XML file by import type - Schema in import Manager

    Hi,
    I am trying to import the xml file by selecting type XML Schema. I have already created an XML Schema in console  based on the XSD file from my desktop and the same is visible in dropdown of XML Schema Tab while importing.
    But I am not able to import the XML file based on the XML Schema. I got the Logon Error As : "Cannot load XML file"
    Content of the error is like -
    (Error:
    Commerror80004005 Unsepcified error
    Source=mdxml4.dll    Description= file:///C:/DOCUM...............
    The Namespace provided Differs from the schema's 'http://n............)
    Please have you inputs as this is a very critical requirement to pull the XML file based on XML schema automatically based on the ports created in console.
    Response wud be highly appreciated.
    Thanks & Rgds/Pawan

    Hi Jason,
    Thanks for your response!
    I don't mind you in taking my thread to core MDM stuff. It would be big relief for to have an response on my query.
    Actually this is a problem with respect to SRM MDM Catalog.....
    I am waiting see the following response threads based on my query..
    Thanks once again!
    Best Rgds/Pawan

  • Path in Classpath for file SapMetamodelWebdynproContent.zip not found.

    How to get rid of these warnings?
                   [Warning]: Path in Classpath for file SapMetamodelWebdynproContent.zip not found.          
    Warning               [Warning]: Version for file SapMetamodelWebdynproContent.zip not found.          
    Warning               [Warning]: Versions of 'SapDictionaryTypeServices.jar' have different prefix.          
    Warning               [Warning]: Versions of 'SapDictionaryTypesRuntime.jar' have different prefix.     
    thanks in advance.

    Hi,
    This is a common problem when you import projects to NWDS. Do like this.
    1.Change to Navigator tab in NWDS and delete gen_wdp folder.
    2.Switch to Web Dynpro Explorer. Select the Project -> Right click-> Select properties -> in the wizard select Java Build Path -> Select Libraries tab -> You will find jar files with warnings
    3.Remove the jar and add the jar file with same name to the project one by one.
    4.For each jar file repeat step 3.
    5.Save the project
    Or
    removed the read-only property from all folders / files of the project and it solved my problem.
    Hope this helps!!
    Thanks & Regards
    Vijay K

  • Firefox keeps asking me what program to use to open file types even though I have selected one and checked "do this for all files of this type" going foward

    I am working in Windows and every time I open an attachment, Firefox asks what program to use to open files of this type. I always select the proper program and then check the box that says use this program for all future files of this type. In spite of that, the program continues to ask for every file. How do I turn off this feature and just have the program remember the correct program to use for each type of file extension?

    Regardless of your download preferences, web servers can trigger a download prompt by sending either the ''Content-Type: application/octet-stream'' or the ''Content-Disposition: attachment'' header. You can check if that's the case by examining the server response headers in the [https://developer.mozilla.org/docs/Tools/Web_Console Web Console].
    For the latter problem install the InlineDisposition add-on and see if it helps.
    * https://addons.mozilla.org/firefox/addon/inlinedisposition/
    If the problem persists, post back here with either an example link or a screenshot of the relevant response headers in the Web Console.
    * [[How do I create a screenshot of my problem?]]

  • Where to find the OC4J-ready Pet Store Demo file jps112.zip

    where to find the OC4J-ready Pet Store Demo file jps112.zip in OTN
    So that we may better diagnose DOWNLOAD problems, please provide the following information.
    - Server name
    - Filename
    - Date/Time
    - Browser + Version
    - O/S + Version
    - Error Msg

    You have to execute the installer jar file.
    This will create a folder with all the source codes inside.
    I wasn't aware of any need for cvs.

  • Unable to open multiple files of different types simultaneously

    It seems  the MS has made some changes in Win7, and I am no longer able to open multiple files of different types (.doc, .pdf) in Explorer by highlighting the desired files and hitting Enter.  It still works if I select only one file type, but
    the ability to open multiple files of different types has been in place since Win95, and maybe since Win3.11 (my memory is a little foggy that far back).

    Hi,
    Yes, this feature was removed from Windows 7. Now you just can open multiple files which are the same type at once.
    Karen Hu
    TechNet Community Support

Maybe you are looking for

  • JWS 1.4.2_06 NoClassDefFoundError

    Help! I am trying to deploy a new application written in java version 1.4.2_01-b06. The network people pushed out JWS version 1.4.2_06 to almost 2000 workstations. The new app will not work with that JWS and returns the error message listed below (No

  • HT4854 I can't re-download my copy of lion of the app store as my current OSX is too new.

    I have tried to re-install and older OSX (lion) from a boot-able USB stick. When i attempt to boot from this stick i get a grey crossed out circle on the screen, stopping me from proceeding. I am unable to re download OSX Lion from my mac as it is cu

  • Forms6i server & Java 1.3 : When ???

    Forms6i & Java 1.3 : When ???

  • Importing Premiere Sequence - only partial

    From Premiere Pro, I selected an 11 minute sequence - which contains about 30 clips - and then File/Send to Adobe Speedgrade The sequence only partially came over.  It stops at 3 minutes 25 seconds or so and in the middle of a clip.  Any ideas?  I am

  • Different SAP mount points reaching to 99% full

    Hi Masters, Presently i am working on different Solaris implemented SAP Clients. o/s --> Solaris DB --> Oracle  10g after reaching the threashold value server is throwing an alert message say suppose /Oracle            99% full /USR/SAP        98% fu