Marcel Epp Posted February 17, 2016 Share Posted February 17, 2016 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"); Link to comment Share on other sites More sharing options...
Pete Posted February 17, 2016 Share Posted February 17, 2016 This might help: https://gist.github.com/kongondo/5728053 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now