I have developed a module with a form, one of the fields is a file upload. It all works correctly including saving the file to disk but Drupal shows this error message:

warning: Invalid argument supplied for foreach()...

I am uploading a jpg which is one of the allowed file types. Can someone point me in the right direction to remove the message?

Thanks!

Comments

Probably something wrong with

Probably something wrong with your code.

Full-time freelancer, always looking for work.
jaypan.com (my portfolio)

There might be some problem

There might be some problem with image name which you have uploaded. Because it will not allow some special characters. And also check file system and file system path. I hope it will work. If you have any queries please let me know.