Access - Creating Groups Based On Total File Size (1 Viewer)

EzGoingKev

Registered User.
Local time
Today, 08:15
Joined
Nov 8, 2019
Messages
178
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:

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 07:15
Joined
Feb 28, 2001
Messages
26,996
I'm not sure I understand entirely. What has a size limit? The ZIP folder or the destination folder or something else?
 

EzGoingKev

Registered User.
Local time
Today, 08:15
Joined
Nov 8, 2019
Messages
178
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.
 

Isaac

Lifelong Learner
Local time
Today, 05:15
Joined
Mar 14, 2017
Messages
8,738
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:

jdraw

Super Moderator
Staff member
Local time
Today, 08:15
Joined
Jan 23, 2006
Messages
15,361
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

Top Bottom