Fortinet FortiOS firmware upgrade – Upload file is too big or invalid
If you receive an “Upload file is too big or invalid” error message when trying to upload a new FortiOS image to your Fortinet device via the web interface, then the first thing to try is giving the device a quick reboot in order to free up memory to hold the uploaded copy of the firmware image.
If this doesn’t fix the problem, then I’ve had much more success with running the update process from command line, although this does require you to have the new FortiOS image on a TFTP server so that the Fortinet device can download it. Once you have issued the command, the device will download the new image and reboot.
The exact command varies depending on the deice type, for example FortiGate devices have the option of FTP or TFTP downloads, whilst FortiMail devices can only download new FortiOS images via TFTP.
For a FortiGate device:
exec restore image tftp
For a FortiManager device running FortiOS 3.x:
exec restore image
For a FortiManager device running FortiOS 4.x:
exec restore image tftp
For a FortiAnalyser device running FortiOS 3.x:
exec restore image
For a FortiAnalyser device running FortiOS 4.x:
exec restore image tftp
For a FortiMail device running FortiOS 3.x:
exec restore image
For a FortiMail device running FortiOS 4.x:
exec restore image tftp
Depending on the device and FortiOS version, you may have other file transfer options such as FTP available to you. Devices registered with a FortiManager can also update their FortiOS image by downloading a new one from the FortiManager unit.
If you are still having problems getting the new FortiOS firmware image onto your Fortinet device, then you can also download a FortiOS image via TFTP from within the Fortinet bootloader/BIOS using the serial console.
Connect a serial console to your device and reboot it, then interrupt the boot sequence when prompted. In the menu, select the option to download a new FortiOS firmware image and provide the file name, server IP address and local IP address.
Right at the start of the bot process, you should see a message along the line of:
Press any key to display configuration menu…
Once you have pressed a key, then the following configuration menu should appear:
[G]: Get firmware image from TFTP server.
[F]: Format boot device.
[B]: Boot with backup firmware and set as default.
[I]: Configuration and information.
[Q]: Quit menu and continue to boot with default firmware.
[H]: Display this list of options.Enter G,F,B,I,Q,or H:
At the configuration menu, type “G” and press enter and you will be asked to enter the details needed to TFTP a new image to your Fortinet device:
Enter TFTP server address [192.168.1.168]:
Enter local address [192.168.1.188]:
Enter firmware image file name [image.out]:
You will need to be on the same subnet as the TFTP server in order to do this.