Bug #2984: Apply fix for file uploads
(cherry picked from commit ee338c3ceaa46aa09609b2d9f59b3ab948532437)