Cant upload files with spaces in the name

Last post 04-26-2010, 2:30 PM by Eric. 1 replies.
Sort Posts: Previous Next
  •  04-25-2010, 12:17 AM 60380

    Cant upload files with spaces in the name

    I know this is dumb but many of my forum users are trying to upload files that have special characters or spaces in them. How can I prevent that? or how can i remove the special characters inclduing spaces and replace these with - or _ in the uploaded file name.
     
    Thanks
     
  •  04-26-2010, 2:30 PM 60413 in reply to 60380

    Re: Cant upload files with spaces in the name

    Dear SoloX,
     
    Uploader is a tool to help you upload files.
     
    When the file is uploaded , the uploader will save the file to temp folder at first.
     
    And the name of the file is also a temp name.
     
    You need write code to move the file to your target location , and then maintain it by yourself.
     
    Please check the sample ,
     
    demo2.php and demo2_upload.php
     
    demo2.php use this to specify a handler
     
        $uploader->UploadUrl="demo2_upload.php";
    demo2_upload.php move the file to another place
     
       $targetfilepath= "savefiles/" . $mvcfile->FileName;
     
     
    You can modify the demo2_upload.php , change the  $targetfilepath, and remove space or change it to other character.
     
    Regards,
    Eric
View as RSS news feed in XML