Nabi K.A.Z.
Nabi K.A.Z.

Reputation: 10724

Set $_FILES array manually and use move_uploaded_file function

If I don't use upload form and just set $_FILES array I can not use of move_uploaded_file() function for save:

move_uploaded_file($_FILES['uploaded']['tmp_name'], $target); //false

How do I make this deceit!!! this means I want to set $_FILES manually but also I want to use move_uploaded_file() function too.

Is it possible?!

Upvotes: 2

Views: 1503

Answers (2)

Kalaiyarasan
Kalaiyarasan

Reputation: 13424

No this is not possible at all we can set the all the values manually for $_FILES as consider as a variable. But for moving the files the temp_name important.

Upvotes: 1

xkeshav
xkeshav

Reputation: 54050

No this is not possible. taken from Manual

$_FILES is a 'superglobal', or automatic global, variable. This simply means that it is available in all scopes throughout a script.

Upvotes: 2

Related Questions