Results 1 to 6 of 6
  1. #1

    Need some php help please :)


    I downloaded this file :

    its a upload script, what it does is simply upload, but i wanted to add a field to RENAME the file before fulle uploaded and make the field COMPULSARY!

    i just asked the maker of the script, he was in a hurry to leave city because he was going on holiday, so he told me i need to edit

    if(@move_uploaded_file($_FILES['SFUfile']['tmp_name'][$i], $fullname)) {
    (FROM upload.php)

    but i still dont get how do i add the field in the first place to allow me to edit it! i checked, the veriable $fullname is the varibale which i need to make the form change the name to, but i dont know where to edit, the script is abit wierd to edit!

    it would be just amazing if someone was to tell me how to add another field under or beside the upload field to rename a file and make it compulsary.

    Thank you very much

  2. #2
    just add a text field to the form and name it newName. Then just replace $fullname with $POST_['newName'] in that line.

  3. #3
    i tried that code... it did compile it, BUT when i upload a file, it DOES upload, but at the end just cancels! i think its because i cant change the name, so the file isnt fully uploaded, but it did check IT does upload, but wont change the name!

    Any other ideas?

  4. #4
    Well I don't have time to look into it right now, but another way to go is to upload it using the old name, and then once its successfully uploaded you can call a couple lines of code that rename the folder on the server (as opposed to renaming before upload).

  5. #5
    Join Date
    Dec 2003
    ./Southest Missouri
    Ok, so I had a little free time today. Consider this my "doing things for others contribution of the day.

    Just replace the functions.php and upload.php files with the ones included in this .rar file. Uploaded and tested already on my own server.


  6. #6
    WOW, you are too kind. I cant thank you enough. Works perfect like you said.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts