ian12345 wrote: Could I get this error if there is not enough flash space?
Yes. So follow what @bamaskas suggested about freeing up space on flash (valid for standalone Switch and/or IRF scenario).
Basically you can get rid of any btm files on flash (generally you could find just one) since that BootROM file is used just to flash the EPROM and then can be safely removed from Switch's flash storage. On the other hand bin files (generated by dearchiving the previous ipe file) can be removed too if you plan to NOT reboot the Switch before completing the new ipe file deployment (so you free up space on flash, deploy the new ipe file and then consequently reboot...rebooting in between should be avoided because doing so your Switch will stall since you had removed, to free up space, necessary (System|Boot) bin files that should be available during Switch boot to previous system|boot bin files considering you didn't completed the upgrade that will install new system|boot bin ones automatically from new ipe)...so, in few words, doing all in one step is possible: (a) free space (eventually you can backup btm, bin files via an ftp put to your FTP Server for future reference), (b) deploy new ipe and (c) reboot when Switch requests to do so (not before).
Edit: from a post I wrote some time ago,
Issue a dir /all CLI Command to display all files (hidden files and folders too), not only non hidden ones as the simple dir CLI Command does.
When you issue a simple delete filename CLI Command the deleted file goes to the flash recycle-bin folder (which is hidden); deleting that way, with the usual delete, is just moving files...not really erasing them from the flash (indeed you can issue the undelete filename CLI Command to recover deleted file).
When instead you issue a delete /unreserved filename the file is definitely erased and no undelete action is possible.
To definitely empty the recycle-bin hidden folder perform a reset recycle-bin (it requires confirmation(s)) or a reset recycle-bin /force (it doesn't require confirmation(s)).
Eventually consider to execute a dir /all .trash command to currently report what there is in the trash can.