Reduce complexity of file upload logic

Signed-off-by: Simon Leung <leungs@us.ibm.com>
Fixes bug where null json value caused panic

[Fixes #82292538]

Signed-off-by: Bruno Alvisio <balvisio@mit.edu>