Dynamic Image uploading - Php

Image Uploading

Snippet Code


  
Rate this page :
  [ 0 votes]

<?php require_once 'upload_config.php'; if($clear_folder_before_upload){ $mydirectory = myUploadDir(); EmptyDir($mydirectory); } $uploaded_file_counter=0; $UploadLimit = $_POST['counter']; for($i=0;$i<=$UploadLimit;$i ){ $file_tag='filename'.$i; $filename=$_FILES[$file_tag]['name']; if($filename!=null) { $rand=time(); $str="$rand$filename"; $filedir= myUploadDir(); $string= $filedir.$str; $patterns[0] = "/ /"; $patterns[1] = "/ /"; $patterns[1] = "/ /"; $replacements[1] = "_"; $dirname=strtolower(preg_replace($patterns, $replacements, $string)); if($check_file_extentions) { $allowedExtensions = allowedfiles(); foreach ($_FILES as $file)

Tags


Ask Questions

Ask Question