Download a zip file with gui_download = CRC error

Hello erverybody,
I download a zip compressed file with gui_download (cl_gui_interface_services) in binary mode.
When I try to open it, I have a crc error. Does anybody has any idea why?
here the code:
       TYPES: begin of t_zip,
             text(1024) type c,
             end of t_zip.
      DATA: itab_zip type table of t_zip,
            wa_zip type t_zip.
      OPEN DATASET p_fileon IN BINARY MODE FOR INPUT.
      IF sy-subrc <> 0.
        MESSAGE text-e01 TYPE 'E'.
      ENDIF.
      DO.
        READ DATASET p_fileon INTO wa_zip MAXIMUM LENGTH 1024.
        APPEND wa_zip TO itab_zip.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
      ENDDO.
      CLOSE DATASET p_fileon.
      MOVE p_filedw TO filename.
      CALL METHOD cl_gui_frontend_services=>gui_download
        EXPORTING
          filename                  = filename
          FILETYPE                  = 'BIN'
        CHANGING
          data_tab                  = itab_zip
Thanks
Joachim

Hi Joachim,
1. use this code (just copy paste in new program)
2. It will download from SERVER to front-end.
3.
*& Report  YBCR_FILEDOWNLOAD                                           *
REPORT  ybcr_filedownload                       .
DATA
DATA : file_name TYPE string.
DATA : BEGIN OF itab OCCURS 0,
       ln(255) TYPE c,
       END OF itab.
SCREEN
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS : appfn(150) TYPE c LOWER CASE OBLIGATORY.
PARAMETERS : p_file LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
  CLEAR p_file.
  CALL FUNCTION 'F4_FILENAME'
    IMPORTING
      file_name = p_file.
  file_name = p_file.
START-OF-SELECTION
START-OF-SELECTION.
  OPEN DATASET appfn FOR INPUT IN TEXT MODE  ENCODING DEFAULT .
  IF sy-subrc <> 0.
    MESSAGE s999(yhr) WITH 'COULD NOT OPEN FILE ON APP SERVER'.
    LEAVE LIST-PROCESSING.
  ENDIF.
  DO.
    READ DATASET appfn INTO itab.
    IF sy-subrc = 0.
      APPEND itab.
    ELSE.
      EXIT.
    ENDIF.
  ENDDO.
  file_name = p_file.
  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
  BIN_FILESIZE                    =
      filename                        = file_name
  FILETYPE                        = 'ASC'
  APPEND                          = ' '
  WRITE_FIELD_SEPARATOR           = ' '
  HEADER                          = '00'
  TRUNC_TRAILING_BLANKS           = ' '
  WRITE_LF                        = 'X'
  COL_SELECT                      = ' '
  COL_SELECT_MASK                 = ' '
  DAT_MODE                        = ' '
  CONFIRM_OVERWRITE               = ' '
  NO_AUTH_CHECK                   = ' '
  CODEPAGE                        = ' '
  IGNORE_CERR                     = ABAP_TRUE
  REPLACEMENT                     = '#'
  WRITE_BOM                       = ' '
  TRUNC_TRAILING_BLANKS_EOL       = 'X'
  WK1_N_FORMAT                    = ' '
  WK1_N_SIZE                      = ' '
  WK1_T_FORMAT                    = ' '
  WK1_T_SIZE                      = ' '
IMPORTING
  FILELENGTH                      =
    TABLES
      data_tab                        = itab
  FIELDNAMES                      =
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
  OTHERS                          = 22
  IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
regards,
amit m.

Similar Messages

  • Finder crashed after downloading a zip file with pictures

    First my desktop icons disappeared. Then the finder, appears and disappears every 3 seconds. Simultaneously the Finder also disappears and reappers in the "Force Quit Application" window. This started after I downloaded a zip file with family photos from a friend (on a windows machine). Rebooted off the Tiger installation dick. Running disk utility off the Tiger installation disk did not help. Permissions were repaired but the finder is still crashing Tried relaunching the Finder from the "Force Quit Application" window. No help. Ran Virex (outdated by 12 months) without any benefit.
    Any suggestions would be appreciated.

    There's a shameful glitch in Finder where if you drag certain attachments off a mail document onto the Desktop the Finder will do its quit/relaunch jitter bug--will also do it for illegally named files on the Desktop, and will hang for dang near forever it you accidently drop 100s of files onto the Desktop. The easy solution is to start the affected machine in target disk mode, hook it up by firewire to another Mac, then navigate to the affected user's Desktop folder and move the funky file or files into a new folder.
    Francine
    Francine
    Schwieder

  • Firefox insists on downloading a zip file with an application. Options is set to ask for download loaction but does not work

    When downloading a ZIP file I get a 'Launch Application' window.
    In Options I have set download to ask for a location and use the download window but this does not work.
    cannot find any way of changing this and there is no option for using an application.
    If I down load in IE I have no problems so it must be FireFox and not a system problem.

    I have found the problem.
    A download manager had been installed for a specific website and it was butting in all the time. Even after removing it with 'Add or remove software' it still had its hooks into the system and it was impossible to download anything as it now would not run.
    Had to do an XP 'System restore' before I could get rid of it.
    The offending program was MD_setup.exe size 3,045KB from the themediadownloader.com

  • How can I fix error code 131:4? Licensing for this product stopped working. I have windows vista home edition and CS4 Design Premium. I downloaded licensing zip file for windows but I can't seem to get it to launch. Look forward to help from anyone

    How can I fix error code 131:4? Licensing for this product stopped working. I have windows vista home edition and CS4 Design Premium. I downloaded licensing zip file for windows but I can't seem to get it to launch. Look forward to help from anyone

    Steve,
    I appreciate your answer.  While it might work, I'm a bit hesitant to remove the other programs as a possible solution since they are all currently working.
    With Acrobat 9 Pro failing with the OS 10.7 upgrade, I'm hoping that there is a less severe solution.
    Since the trigger appears to be 10.7 and may have something to do with the discontinued support of Rosetta, I could be spending a few hours working on a reinstall without a change.  Yes, it might work.  The "might" is the part that makes me hesitate.
    Is anyone else out there on OS 10.7 and running Acrobat 9 Pro?  Any issues with anyone else?
    Thanks Steve.  I do appreciate your offering a solution.  I may end up trying it if nothing else comes together.
    Mark

  • How to zip a folder containing subfolders with files and download the zip file in silverlght 4

    private void hbtnDownloadReceipt_Click(object sender, RoutedEventArgs e)
               try
                    string Docpath = "ClaimsDetails/" + "20tech" + "/" + PaymentAdviceUNo;
                    string dd = "ClaimsDetails/";
                    Uri uri = new Uri(Application.Current.Host.Source, "/" + Docpath);
                    Uri uri1 = new Uri(Application.Current.Host.Source, "/" + dd);
                    string path = uri.AbsoluteUri.ToString();
                    path1 = uri1.AbsoluteUri.ToString();
                    //HtmlPage.Window.Eval("window.open('" + path + "')");
                catch (Exception ex)
                    ex.Data.Clear();
    1) Here "path" is D:\\TL 24-12-2014 \\OfficeConnect_17_10\\OfficeConnect.Web\\ClaimsDetails\\20tech\\PaymentAdviceUNo.     
    2) In path "PaymentAdviceUNo" is the folder containing subfolders which i want to zip.
    Thanks in Advance.

    Hi,
    You can download a zip file like any files with the Webclient class, look at the details and examples in the msdn documentation for downloading content on demand it even talks about how to download and get a specific file from a zip archive.
    http://msdn.microsoft.com/en-us/library/cc189021(VS.95).aspx
    Besides,  if you want to list the files,you could check articles below:
    http://blogs.msdn.com/b/blemmon/archive/2009/11/25/reading-zip-files-from-silverlight.aspx
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Cannot extract Zip file with Winzip after zipping with java.util.zip

    Hi all,
    I write a class for zip and unzip the text files together which can be zip and unzip successfully with Java platform. However, I cannot extract the zip file with Winzip or even WinRAR after zipping with Java platform.
    Please help to comment, thanks~
    Below is the code:
    =====================================================================
    package myapp.util;
    import java.io.* ;
    import java.util.TreeMap ;
    import java.util.zip.* ;
    import myapp.exception.UserException ;
    public class CompressionUtil {
      public CompressionUtil() {
        super() ;
      public void createZip(String zipName, String fileName)
          throws ZipException, FileNotFoundException, IOException, UserException {
        FileOutputStream fos = null ;
        BufferedOutputStream bos = null ;
        ZipOutputStream zos = null ;
        File file = null ;
        try {
          file = new File(zipName) ; //new zip file
          if (file.isDirectory()) //check if it is a directory
         throw new UserException("Invalid zip file ["+zipName+"]") ;
          if (file.exists() && !file.canWrite()) //check if it is readonly
         throw new UserException("Zip file is ReadOnly ["+zipName+"]") ;
          if (file.exists()) //overwrite the existing file
         file.delete();
          file.createNewFile();
          //instantiate the ZipOutputStream
          fos = new FileOutputStream(file) ;
          bos = new BufferedOutputStream(fos) ;
          zos = new ZipOutputStream(bos) ;
          this.writeZipFileEntry(zos, fileName); //call to write the file into the zip
          zos.finish() ;
        catch (ZipException ze) {
          throw ze ;
        catch (FileNotFoundException fnfe) {
          throw fnfe ;
        catch (IOException ioe) {
          throw ioe ;
        catch (UserException ue) {
          throw ue ;
        finally {
          //close all the stream and file
          if (fos != null)
         fos.close() ;
          if (bos != null)
         bos.close();
          if (zos != null)
         zos.close();
          if (file != null)
         file = null ;
        }//end of try-catch-finally
      private void writeZipFileEntry(ZipOutputStream zos, String fileName)
          throws ZipException, FileNotFoundException, IOException, UserException {
        BufferedInputStream bis = null ;
        File file = null ;
        ZipEntry zentry = null ;
        byte[] bArray = null ;
        try {
          file = new File(fileName) ; //instantiate the file
          if (!file.exists()) //check if the file is not exist
         throw new UserException("No such file ["+fileName+"]") ;
          if (file.isDirectory()) //check if the file is a directory
         throw new UserException("Invalid file ["+fileName+"]") ;
          //instantiate the BufferedInputStream
          bis = new BufferedInputStream(new FileInputStream(file)) ;
          //Get the content of the file and put into the byte[]
          int size = (int) file.length();
          if (size == -1)
         throw new UserException("Cannot determine the file size [" +fileName + "]");
          bArray = new byte[(int) size];
          int rb = 0;
          int chunk = 0;
          while (((int) size - rb) > 0) {
         chunk = bis.read(bArray, rb, (int) size - rb);
         if (chunk == -1)
           break;
         rb += chunk;
          }//end of while (((int)size - rb) > 0)
          //instantiate the CRC32
          CRC32 crc = new CRC32() ;
          crc.update(bArray, 0, size);
          //instantiate the ZipEntry
          zentry = new ZipEntry(fileName) ;
          zentry.setMethod(ZipEntry.STORED) ;
          zentry.setSize(size);
          zentry.setCrc(crc.getValue());
          //write all the info to the ZipOutputStream
          zos.putNextEntry(zentry);
          zos.write(bArray, 0, size);
          zos.closeEntry();
        catch (ZipException ze) {
          throw ze ;
        catch (FileNotFoundException fnfe) {
          throw fnfe ;
        catch (IOException ioe) {
          throw ioe ;
        catch (UserException ue) {
          throw ue ;
        finally {
          //close all the stream and file
          if (bis != null)
         bis.close();
          if (file != null)
         file = null ;
        }//end of try-catch-finally
    }

    Tried~
    The problem is still here~ >___<
    Anyway, thanks for information sharing~
    The message is:
    Cannot open file: it does not appear to be a valid archive.
    If you downloaded this file, try downloading the file again.
    The problem may be here:
    if (fos != null)
    fos.close() ;
    if (bos != null)
    bos.close();
    if (zos != null)
    zos.close();
    if (file != null)
    file = null ;
    The fos is closed before bos so the last buffer is not
    saved.
    zos.close() is enough.

  • Problem on downloading a zip file

    I am having a problem on downloading a zip file(file size is about 2Mb). Sometimes I can get a complete file and can open the file, sometimes the zip file is chunked(the file size is smaller than the right one), so I can't open it.
    The file content is stored in a blob field. The code first goes to database get the blob as inputstream, then copy the inputstream into response.getOutputStream().
    The problem is unpredictable. Even for the same blob data, sometimes I can get working file, sometimes I just get crapped file.
    Could somebody help me out? I am struggling with it.
    Any input is appreciated!
    public class DownloadTextAction extends Action implements Serializable{
        private static Log log = LogFactory.getLog(DownloadTextAction.class);
        public ActionForward execute(ActionMapping mapping, ActionForm form,
                                     HttpServletRequest request,
                                     HttpServletResponse response) throws Exception
            ActionErrors errors = new ActionErrors();
            String batch_id = (String)request.getParameter("batch_id");
            String fileName = batch_id+".zip";
            try
    //          response.setContentType("application/octet-stream");
              response.setContentType("application/download");
      //        response.setContentLength(content.length());
    //          response.setHeader("Content-Disposition", "inline; filename=\""
    //                    + fileName + "\"");
              response.setHeader("Content-Disposition", "attachment; filename=\""
                        + fileName + "\"");
              InputStream in = untilService.getBlob(batch_id);         
              OutputStream out = response.getOutputStream();
              FileHelper.copy(in, out);
              out.flush();
              in.close();
              out.close();
            catch (Exception e)
              errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("error.detail", e.toString()));
              saveErrors(request, errors);
              log.error(e.toString());      
            return mapping.findForward(Constants.SUCCESS);
        }

    Maybe a fault in the missing FileHelper.copy() method?

  • I've downloaded a zip file from noisetrade, but it won't open on my mac...what shall I do?

    Hey guys, wondering if someone could give me some help. I've downloaded a zip file from noisetrade, but it won't open on my mac.I keep clicking and it vhanges to a cgzp file..and even when I changed the end bit to zip, it won't open. I've tried the unarchive app andthat hasn't worked either...what shall I do?
    Thanks in advance :-)

    iWork (no 's') for iOS & iWork for Mac have not gone away.
    iWork.com (beta) (also no 's') is going away the end of July. iWork.com (beta) is/was an online method of sharing iWork files with other users & never moved out of beta in 3+ years. It is a completely different entity than the iWork apps & is not & never has been necessary for the iWork apps to function.
    A Numbers document, as well as Pages or Keynote documents, cannot be opened on a PC. You must first export them to a file that a PC can use. For Numbers that is generally Excel. In Numbers on your iPad tap the wrench & then tap Share & Print & choose Excel as the file type.
    As for transfering a file from a PC to an iPad, I'm not sure as I don't use a PC.

  • Decompress ZIP file with Password

    Hi all,
    Does anybody know how to decompress a ZIP file with password protection?
    I have a decompress code, but I don't know how to insert the pass.
    Any solution?
    Regards

    I'm running out of suggestions over here.
    Your exact command line yields this result:
    zip warning: name not matched: in.txt
    zip error: Nothing to do! (out.zip)
    Well, it should, as I don't have an in.txt. Handing it an existing file, I get this:
    zip -P pass out.zip result.txt
      adding: result.txt (deflated 7%)
    .. and opening in the Finder correctly prompts me:
    so there must be something wrong with your system.
    Very Long Shot: What version do you get when you type this? (I can't imagine this is the actual problem, but you never know.)
    zip --version
    Mine is
    Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
    This is Zip 3.0 (July 5th 2008), by Info-ZIP.
    Currently maintained by E. Gordon.  Please send bug reports to
    the authors using the web page at www.info-zip.org; see README for details.
    Latest sources and executables are at ftp://ftp.info-zip.org/pub/infozip,
    as of above date; see http://www.info-zip.org/ for other sites.
    Compiled with gcc 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00) for Unix (Mac OS X) on May 25 2011.

  • No luck trying to extract .inf files from drivers downloaded as zip files

    Hi,
    I am trying to extract .inf files from drivers downloaded as zip files from the Toshiba website, but I'm having no luck.
    I am trying to deploy images using WDS on server 2008 and need the inf files for this to succeed, does anyone have the answer to this problem.
    thanks in advance.

    Hi
    I found this tip:
    Someone wrote this:
    +You have to run the installer, wait for it to get to the first point where you click Next to continue, and then leave it sitting there. Go into your system's Temp and find the particular one with the installation files inside it that were extracted, then copy it someplace, go back to the installer and cancel it.+
    You could also try this freeware application to extract the package:
    http://www.legroom.net/software/uniextract

  • Any way to disable the automatic unzipping when you download a zip file?

    For example, say I want to download a .zip archive, and have it stay a .zip archive so I can upload it somewhere else.
    The problem with re-zipping it is that I don't want it to be a Mac .zip file with bogus resource forks and DS_STORE files in it (for Windows users). Any zip file you create on a Mac usually has these bogus extra files inside it - confusing to Windows users. If I download a Windows .zip, I want to keep it as a .zip that was zipped on Windows, if you follow me.

    Thank you! I was looking in the System preferences everywhere - did not think of Safari itself.
    BTW, for anyone who cares, I also discovered that in Safari, even when you have the Preferences set to automatically unzip the files, you can override this by control-clicking on the file and choosing "Download Linked File as..."

  • Downloading attached zip file from emails using safari

    How to download, and where will be the downloaded attached zip file in email be stored using safari? How to open and save the zip file attached to the email? Do you need an app to open and store the zip file?

    The app GoodReader (I don't know if there are any free apps that can also do it) can be used to zip and unzip email attachments
    press and hold the zip file in your email - after a couple of seconds you should get a popup, with one option being 'Open in GoodReader' which you should select
    GoodReader should then open with the zip file listed under My Documents
    select Manage Files on the right-hand side of GoodReader, select the zip file, and touch the Unzip button that appears on the right
    You should also be able to download zip files directly into GoodReader by typing the URL in its Wed Downloads sectio.

  • Need to download MDM71500_ENRICHMENT_CONTROLLER.zip file for EC scenario.

    Hi All,
    Does anybody can tell me that where I can find SP05.ZIP file to download?
    I need to download MDM71500_ENRICHMENT_CONTROLLER.zip file object for an enrichment scenario.
    And SP05.ZIP file is not available in SMP(SP 02, 03 ,04 ZIP files and SP 05.SCA files are available in SMP).
    Regards,
    Nirmala.

    Hi Nirmala,
    Since SP05 release, The Enrichment Controller isn't delivered as a ZIP file. The content is now divided. The EC deployment file is located where you suggested (in the EC application download section) and the rest of the package is delivered with MDM business content package and it contains the simulator repository and all the extra content for the Customer and Vendor repositories, in addition you can find there the sample XML and matching XSD files. if you intend to develop an adapter you'll be able to find a sample adapter as well.
    Best Regards,
    Ran

  • I am trying to organize a zip file with a bunch of links and files. But when I drag an image file to a folder, it always "Snaps to grid" instead of just landing where I put it.

    I am trying to organize a zip file with a bunch of links and files. But when I drag an image file to a folder, it always "Snaps to grid" instead of just landing where I put it. All of the files are going into the same zip file but I want them visually in the space that I put them and not at the bottom of the snap to grid folder location they are looking like.  I am trying to  drag and drop files in groups so that I can group them for now, but image files always do their own "sort by" when I drag them from my web pages. Links don't do it though.  I tried resetting the folder, and deleting the DS files. No luck.

    You keep asking variants on this same question. You've had replies in all your other threads. If you can't find them, go here and click where it says Activity:
    Thomas Cannon Jr.

  • I downloaded a .zip file. It ate up my space and i cant find the file. How do i get this file off my phone?

    I downloaded a .zip file. It ate up my space and i cant find the file. How can i get this file off my phone?

    Not possible. Safari won't download and save a Zip file. You either had to use a 3rd party app, or as wjosten suggests, your phone is jailbroken. If the former, you'll need to use that app to find it. If the latter, you'll have to look elsewhere for assistance.

Maybe you are looking for

  • Save As - Settings and Filename Incrementer

    Hello All, I'm on CS5/CS6, i use a panel which i created in configurator. I have it run actions, menu items etc. All works great. Problem: I'm sick and tired of saving each open active image as JPG and incrementing the filename by 1.  I'm hoping some

  • My portal DAD is down even after all correct properties are set.

    Hi, could any one update my question why the DAD is down (checked from OEM console) even after the properties set are correct? is there a way to troubleshoot it? I would be thankfull if I could get the answer/How to trouble shoot it? Thanks, Vijay.

  • Ringtones function not available on my iTunes

    I do not have ringtone functions on my iTunes, I've updated to latest versions, completely uninstalled everything apple or iTune related on my computer, and redownloaded, and still can't get the functions! Flatmates version has right click - create r

  • PSE 7 Slide Show Music

    I am using PSE 7 to create a slide show.  I am attempting to add music but cannot seem to download songs from my itunes library where most of my music is stored. I am runnig Windows 7 and have been able to download from my Windows mucic folders.  Is

  • Difference between wait event and timed event

    Hi, Anyone has idea that what is the difference between wait events and timed events in Statspack report. I couldn't find it over google. Thanks.