Can't Upload/attach Images On Localhost

I'm having a hard time trying to upload images on localhost.

For example in the product template everytime i drag and drop a image it shows the message "cannot upload file".

If i choose the URL option the image will load but doesnt save, it shows "null".

Image folder permission is 777 and upload_max_filesize is set at 100M.

In production is working fine this problem only happens in localhost.

Debugging the code i find out that the function fn_move_uploaded_file is returning false meaning is something related to the path.

Did anybody went thru a similar problem?

Updating...

I after hours of debugging i found out that my project didn't had the folder var/custom_files.

Now I can attach images but when I save it shows null.

So I'm assuming is something related to path. Somehow the files gets lost during the saving process.

Should be /var/custom_files/sess_data/

Should be /var/custom_files/sess_data/

Yes that fixed the problem but when I save it returns null.

I debugged fn_update_image_pairs and it does save the image. When i load the product it shows up in the $product_data array. Also I noticed the image is saved in the right dir images/detailed/2/ and i set the right permission.