Thursday, 15 March 2012

xml - Fixed file name for upload.php script -



xml - Fixed file name for upload.php script -

i'm trying upload xml file server , file named data.xml. info overwritten everytime accessed.

my uncertainty how set file-name fixed name .xml extension extension filter? want place file in same folder upload.php.

here tried far:

<?php $target_path = "uploads/"; $target_path = $target_path . basename($_files['uploadedfile']['name']); if (move_uploaded_file($_files['uploadedfile']['tmp_name'], $target_path)) { echo "the file ", basename($_files['uploadedfile']['name']), " has been uploaded"; } else { echo "there error uploading file, please seek again!"; }

have tried:

<? $target_path = "uploads/"; $target_path = $target_path . 'data.xml'; if(move_uploaded_file($_files['uploadedfile']['tmp_name'], $target_path)) { echo "the file ". basename( $_files['uploadedfile']['name']). " has been uploaded"; } else{ echo "there error uploading file, please seek again!"; } ?>

php xml file-upload upload

No comments:

Post a Comment