Hello,
does anybody know how can i get the filenames from wireupload? In my frontend form is a wireupload.
// New wire upload
$service_upload = new WireUpload('service_file_upload_sw'); // References the name of the field in the HTML form that uploads the photo
$service_upload->setMaxFiles(5);
$service_upload->setOverwrite(false);
$service_upload->setDestinationPath($upload_path);
$service_upload->setValidExtensions(array('jpg', 'jpeg', 'png', 'tif', 'tiff', 'gif'));
When i dump $service_upload i get an huge array with $completedFilenames array.
What i'm trying to do is to take the filenames and generate xml files from my input field (email).
This works for one file now, but not for more then one.
$withoutExt = preg_replace('/\\.[^.\\s]{3,4}$/', '', $filename);
// create xml for switch
$doc = new DOMDocument('1.0');
// we want a nice output
$doc->formatOutput = true;
$root = $doc->createElement('phpemail');
$root = $doc->appendChild($root);
$email = $doc->createElement('email');
$email = $root->appendChild($email);
$text = $doc->createTextNode($np->email);
$text = $email->appendChild($text);
$doc->save($upload_path . $withoutExt . ".xml");