I've a function asking for a $_FILES argument:
function insertarticle($ particle,...... ,$pUserID,$pOpt ions,$files){
in this function I do add the record and then save the files in a
subdirectory specific on some datas.
This function is used by my "insert" form, letting the user to select images
files to upload with <FILE> html tag.
The files to upload are then passed to the $files like this:
insertarticle(1 884,......,4,$O ptions,$_FILES) ;
for mantainance purpose, I avoid as much as possible to have the same code
in 2 different pages. Also, using actually this function to add a record in
the database (quite complex code) and saving files from a form, and using
the same function to add records from an XML parser, I can't send images
files to the function.
My parser can save the images files on the server's directory, but how to
pass $files parameters in order to save those files ? It's there any way to
take the string containing the base64 image code (I do actually save it
locally) and put it in a $_FILES array for passing it to the function ?
thanks for help.
Bob
function insertarticle($ particle,...... ,$pUserID,$pOpt ions,$files){
in this function I do add the record and then save the files in a
subdirectory specific on some datas.
This function is used by my "insert" form, letting the user to select images
files to upload with <FILE> html tag.
The files to upload are then passed to the $files like this:
insertarticle(1 884,......,4,$O ptions,$_FILES) ;
for mantainance purpose, I avoid as much as possible to have the same code
in 2 different pages. Also, using actually this function to add a record in
the database (quite complex code) and saving files from a form, and using
the same function to add records from an XML parser, I can't send images
files to the function.
My parser can save the images files on the server's directory, but how to
pass $files parameters in order to save those files ? It's there any way to
take the string containing the base64 image code (I do actually save it
locally) and put it in a $_FILES array for passing it to the function ?
thanks for help.
Bob
Comment