Access - Creating Groups Based On Total File Size

EzGoingKev

Registered User.
Local time
Today, 01:29
Joined
Nov 8, 2019
Messages
199
I am not sure how I need to do this so I am posting in General.

I need to upload images into a web based UI. They are loaded using a ZIP folder. The UI limits the folder size to 300mb.

I have a data set that consists of an distinct ID, a distinct image part number, and the image file size in MB.

Right now I have images for (48) part numbers with a total size 842.35mb. I need to split them up. I want to create groups based on the 300mb limit that will give me a list of images to load at one time.

What is the best way to do this?
 
Last edited:
I'm not sure I understand entirely. What has a size limit? The ZIP folder or the destination folder or something else?
 
I am sorry, that was not clear in my OP.

The program that I upload the ZIP folder to will not accept a folder larger than 300mb.
 
Maybe

For extra ease, maybe add a column "Zipped" (column type=Date)

Code:
dim rs as dao.recordset, db as dao.database
set db=currentdb

do until dcount("*","table","zipped is not null")=0
    set rs=db.openrecordset(open your recordset here - where zipped is null AND do a TOTALS query & a query on that going only to 300 MB)
    do until rs.eof=true
        'code to move this into a zip folder, many examples on the web
        rs.movenext
    loop
    rs.close
    set rs=nothing
loop
 
Last edited:
You may get some insight for an algorithm from this material on knapsack problem.
There are many youtube videos on this as well.

Perhaps the bigger issue is related to the zipping factor. For example, 500 mb of raw images may be only 300mb when zipped. So identifying the sum of raw image sizes to the size of the zipped file may be an issue(uncertainty).
 

Users who are viewing this thread

Back
Top Bottom