I downloaded WP Dropzone and had a look at the code. AFAICT the function you are working on is called via AJAX, once a file is dropped/uploaded. In that case, there is no "post" in the current request - you're in an AJAX file unrelated to any post.
So the question becomes how to get the ID of the post that called the current AJAX request. I found this SO answer which answers that:
$url = wp_get_referer(); $post_id = url_to_postid( $url );