Problem with multiple Uploads: 'Invalid Guid'

  •  10-15-2010, 6:32 AM

    Problem with multiple Uploads: 'Invalid Guid'

    Hello,
     
    what I'm trying to do is the following:
    Providing an upload module for different imagesets...
     
    But as soon as there is more than one image (in my case), the saving fails with the above mentioned error message...
     
    Furthermore there seems to be no effective way to prevent the upload of more than one file per Uploader (which would have been the annyoing workaround) ... you get an error-Alert with "MultipleFilesUpload" set to false when selecting more than one file in the "Select file"-Dialogue but if you add just one file per click on "Upload" the files are added and submit then crashes (see above)...
     
    The POST is sent with an "/" to separate the entries, but the preg_match in "PhpUploader_GetGuid()" then fails, because the "/" is not allowed...
     
    Here are some further suggestions:
    - it is not possible to cancel uploads, once they are uploaded (would be handy, if you can just upload e.g. 5 pics, but you change your mind later)
    - a preview of the files (if imagefiles)  would be handy
    well, i tried to to build the qeueelist with previews and delete-button myself, but this won't work as long as there is above mentioned error...
     
    here is my code (tested on both: Windows and Linux) :
     
    1. <?php  
    2.         $this->uploader = new PhpUploader();  
    3.         $this->uploader->MultipleFilesUpload = false;  
    4.         $this->uploader->Name="myuploader";  
    5.         $this->uploader->MaxFilesLimit = 1; 

    6.         $fileguid=@$_POST["myuploader"];     
    7.         if($fileguid) {  
    8.             //get the uploaded file based on GUID     
    9.             $mvcfile = $this->uploader->GetUploadedFile($fileguid);     
    10.             if($mvcfile) {
    11.                $mvcfile->MoveTo(RDA_TEMP.File::getUniqueFileName($mvcfile->FileName,RDA_TEMP));   
    12.             }     
    13.         }  
    14. ?>  
    15. <script language="javascript" type="text/javascript">  
    16.             function CuteWebUI_AjaxUploader_OnQueueUI(list) {  
    17.                       
    18.             }  
    19.             function CuteWebUI_AjaxUploader_OnPostback() {  
    20.             } 
    21. </script>
    22.   
    23. <form id="form1" method="POST">      
    24.             <fieldset>  
    25.                  <?php $this->uploader->Render(); ?>
    26.             </fieldset>  
    27.             <input type="submit">  
    28.         </form>
     
     
     
View Complete Thread