dcsimg
Results 1 to 9 of 9

Thread: RAR file type support for attachment

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2012
    Posts
    1,303

    RAR file type support for attachment

    RAR allows some extra compression compared to ZIP in order to be under the file size limit.

    Currently I upload a .rar file with an extra .zip extension.
    However, that's not ideal and it would be better and easier to allow .rar right away.

    Thanks

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    102,995

    Re: RAR file type support for attachment

    Given that a large proportion of people these days rely on the ZIP functionality built into Windows, it's generally not a good idea to use alternative compression methods. Many people just won't be able to open a RAR file. Probably better to upload multiple ZIP files, if possible.

  3. #3
    PowerPoster
    Join Date
    Feb 2006
    Posts
    20,549

    Re: RAR file type support for attachment

    I agree. I won't download any RAR or 7-zip file from some random person since they tend to attract the hacker community in the first place. To me they're a kind of "badge of ill repute."

    Anything so large that additional compression is that important probably shouldn't be posted here anyway. I'm sure there are exceptions here and there but they probably need another solution.

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2012
    Posts
    1,303

    Re: RAR file type support for attachment

    Multiple zip files are not supported.
    Can't upload .z01 file here..

  5. #5
    Administrator Steve R Jones's Avatar
    Join Date
    Apr 2012
    Location
    Dallas, TX
    Posts
    1,017

    Re: RAR file type support for attachment

    FileOne.zip
    FileTwo.zip

    etc - is allowed.

    Just last week we added 7-zip file type with a rather large file size allowed...

  6. #6
    Administrator Steve R Jones's Avatar
    Join Date
    Apr 2012
    Location
    Dallas, TX
    Posts
    1,017

    Re: RAR file type support for attachment

    FileOne.zip
    FileTwo.zip

    etc - is allowed.

    Just last week we added 7-zip file type with a rather large file size allowed...

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2012
    Posts
    1,303

    Re: RAR file type support for attachment

    Quote Originally Posted by Steve R Jones View Post
    FileOne.zip
    FileTwo.zip

    etc - is allowed.

    Just last week we added 7-zip file type with a rather large file size allowed...
    But I would like to split by zip functionality.
    Means
    1.zip
    2.z01

    Having instead
    1.zip
    2.zip

    will not work as it does not get recognized that these belong together.

  8. #8
    Addicted Member
    Join Date
    Aug 2017
    Posts
    245

    Re: RAR file type support for attachment

    Krool, just use the 7z format as already suggested. It is on par with the Rar format in terms of compression ratio.

  9. #9
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    5,442

    Re: RAR file type support for attachment

    I guess, if I had to, I would just write a little utility program where I could pass the zip file to it, and it would split it into several zip files.
    Here's a hardcoded VB6 example, but making a little utility would be better.

    {p.s. Of course the "zip" files created are not valid zip files, so you would warn the user they have to use the provided command line to join the files back together to create a valid zip file}

    Code:
    Option Explicit
    
    Private Sub Command1_Click()
      Open "c:\c\tmp\tmp\AnalogClockReadingTest.zip" For Binary As #1
        Dim size_t As Long, size_1 As Long, size_2 As Long
      
        size_t = LOF(1)
        size_1 = size_t \ 2
        size_2 = size_t - size_1
      
        ReDim b1(size_1 - 1) As Byte
        ReDim b2(size_2 - 1) As Byte
        Get #1, , b1
        Get #1, , b2
      Close #1
      
      Open "c:\c\tmp\tmp\AnalogClockZipTest_01.zip" For Binary As #1
        Put #1, , b1
      Close #1
      
      Open "c:\c\tmp\tmp\AnalogClockZipTest_02.zip" For Binary As #1
        Put #1, , b2
      Close #1
    End Sub
    The above code could be rewritten for instance, to use two file handles so you leave the input file open, and just use one byte array and read a chunk, write the chunk to a file. That way the whole file wouldn't have to be in memory at once, but given the size of what we would want to upload, having the whole file in memory is not likely to be an issue.

    Then, just post a little command line that the user can copy to recombine the files, e.g.

    Open a cmd window where the files were downloaded, copy and past this line into the cmd window to stitch the files back together:

    copy /B AnalogClockZipTest_0*.zip AnalogClockZipTest.zip
    "Anyone can do any amount of work, provided it isn't the work he is supposed to be doing at that moment" Robert Benchley, 1930

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width