php - Handling File Uploads when a property is added from the Javascript File Object
When I receive files via POST I get the defaultname
,type
,size
,tmp_name
,error
but the file I'm sending has additional information that I would like PHP to receive.
For example, above screenshot represents my file object in JavaScript. I added a property callednewName
which I would also like to receive in the global$_FILES
variable in PHP, and then based on the newName property, upload the file on the newName.
Is this possible?
Answer
Solution:
You can set the
name
property of aFile
object at a newFile
objectPeople are also looking for solutions of the problem: cannot add or update a child row: a foreign key constraint fails
Source
Share
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.