I have a webform with a file upload field. When I upload a file in this field, without submitting the form, the file is uploaded using AJAX. Now, I want to make some modifications during this call.
Now, the arguments accessed using arg() give ajax arguments. Whereas I need to access the current node's nid when this AJAX request is being made. But arg() is of no use, as it is giving ajax arguments, e.g. arg(1) gives "ajax".
Now, my question is how do I access my node's nid during this AJAX call?
For more clarity, here are more details for what I'm trying to do:
I want to rename the file being uploaded using ajax. For this, I'll modify the $_FILES variable. But the renaming is to be done according to a pattern which includes the current node's nid.