I tried to load a bin file I created for my project onto the STM32 F303re. The moment I tried to load it, it showed zero bytes available. I am unable to load any program onto the microcontroller since due to this issue.
Maybe try to enter bootloader mode to mass erase the device in non user mode.
Sounds like you are talking about an Arduino or mbed bootloader, which appears as Mass Storage Device.
Try a debug pod (JTAG/SWD) from a C/C++ IDE, or the ST-Link Utility from ST..
Most current ST-LINK Utilities, update firmware, do a full/mass erase of the part.
Then reflect on what your code is doing that might break the debug interface, ie reconfiguring the pins, putting the device in low power mode, etc.
Retrieving data ...