It's difficult to help you, since you didn't show any code.
In general, for some strange reason, I encountered similar errors recently.
In my case, I tried to save the file with the original filename.
The script worked only when I change the name of the file to something else.
E.g. say the original name is cityscape.gif, and I try to save it as cityscape.gif, I get an error. But if I change the name to say a random_number.gif, the upload succeeds.
Richie
geocities.com/akindele/