File limit

Website
merrgames.free.nf

Problem:
unable to upload scratch game to my new website due to file limit

Information:
I have a html scratch game that was made with the snail ide packager.
That is 10.9mb
The file limit is 10mb

any ideas what I could do to lower the limit?

Can’t imagine it’s all HTML, so any JS/CSS can be moved to separate files.

3 Likes

Did you use the “Plain HTML” option in the packager? If so, try changing it to the “Zip” option instead.
image
Then unzip it, and upload the contents of the zip file to your website. That way the contents and assets of your game will all be smaller individual files, instead of the one massive HTML file.

2 Likes

But make sure to unzip it on your local computer and upload the individual files, don’t upload the zip file itself, it won’t work.

3 Likes

the script.js file is 10.3mb it is pretty inportant and cannot be uploaded

If there are functions defined there, try and separate them across multiple files.

4 Likes

How, (i dont know js)

Hi

It depends on how the whole project is packaged

If it is a classic example where you have some index.html (homepage of the game) and inside calls for external JS files

Then when you split that problematic 10.3MB JS file into parts (10 parts or more because the MAX file size for javascript is 1MB on hosting) and in a smart place

then in that idex.html file, it should be
instead of the existing name/call of the problematic JS file (it should be deleted wherever mentioned) a call for 10+ new ones should be placed there

Call in this order:
newJSfile1 (upper part of the code)
and after it
call newJSfile2 (next part of the code)
newJSfile3,4,5,6, etc…

Why ? the order of loading JS scripts is important


I assume it’s big because it contains a lot of different languages ​​etc. and it’s not minified.



But problems are also possible after you adequately divide the code,

because such things often use base64 encoding inside javascript code
where inside are the calls for certain JS files that some JS code calls or checks, and your two new files will no longer have the NAME/s that the script is looking for, so it is very possible that you will have to modify a lot of things in JS in addition to index.html…not in one JS file but possibly in several of them… it all depends on how much they talk to each other and additionally with some server where you made the game.




To split javascript code into many JS files try using AI (if possible with some IDE e.g. VS CODE)

Maybe there is an online service for that also…
The only question with such things is whether they will allow you to upload or copy/paste a 10MB code or they will tell you that the max is 1MB

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.