Newsgroup: it.lavoro.professioni.webmaster
Titolo: upload files

vorrei consentire ai visitatori del mio sito di caricare delle foto le quali 
possono essere selezionate contemporaneamente dalla loro cartella e inviate 
tutte insieme.
cosa mi consigliate?

 cartella e inviate tutte insieme.  cosa mi consigliate?
Una cosa tipo 
http://swfupload.org/
 ?
-- 
4 Template di Landing Page, Squeeze Page, Video Landing Page e Popup
Scaricali da 
http://www.masteringlandingpages.com/template
Vuoi distribuire il tuo sito web su CD/DVD, chavi USB ed installer?
Prova 
http://www.dwebpro.com/

 cosa mi consigliate?
Di controllare il contenuto o ti inietteranno codice a morte.

 Una cosa tipo 
http://swfupload.org/
 ?
esatto pero' volevo qualcosa di gia pronto perchè non sono afferratto in 
flash e quindi non ho ben capito cosa devo farci con i file scaricati! 

 ha scritto nel messaggio 
news:499af4f9$0$17431$4faf...@reader5.news.tin.it...

beh diciamo che ho messo il sample sul mio sito direttamente la pagina si 
apre ma se clicco sul bottone upload non accade nulla come mai?

>
ho copiato il sample ma non funziona proprio
in pratica ho le seguenti cartelle:
- simpledemo che contiene index.php e upload.php piu una cartella js con 
dentro fileprogress.js handlers.js e swfupload.queue.js
- swfupload con i file swfupload.js e swfupload_f9.swf
l'index.php contiene il seguente codice:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
">
<html xmlns="
http://www.w3.org/1999/xhtml
" >
<head>
<title>SWFUpload Demos - Simple Demo</title>
<link href="../css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../swfupload/swfupload.js"></script>
<script type="text/javascript" src="js/swfupload.queue.js"></script>
<script type="text/javascript" src="js/fileprogress.js"></script>
<script type="text/javascript" src="js/handlers.js"></script>
<script type="text/javascript">
  var swfu;
  window.onload = function() {
   var settings = {
    flash_url : "../swfupload/swfupload_f9.swf",
    upload_url: "upload.php", // Relative to the SWF file
    post_params: {"PHPSESSID" : "<?php echo session_id(); ?>"},
    file_size_limit : "100 MB",
    file_types : "*.*",
    file_types_description : "All Files",
    file_upload_limit : 100,
    file_queue_limit : 0,
    custom_settings : {
     progressTarget : "fsUploadProgress",
     cancelButtonId : "btnCancel"
    },
    debug: false,
    // The event handler functions are defined in handlers.js
    file_queued_handler : fileQueued,
    file_queue_error_handler : fileQueueError,
    file_dialog_complete_handler : fileDialogComplete,
    upload_start_handler : uploadStart,
    upload_progress_handler : uploadProgress,
    upload_error_handler : uploadError,
    upload_success_handler : uploadSuccess,
    upload_complete_handler : uploadComplete,
    queue_complete_handler : queueComplete // Queue plugin event
   };
   swfu = new SWFUpload(settings);
      };
 </script>
</head>
<body>
<div id="header">
 <h1 id="logo"><a href="../../areasoci">SWFUpload</a></h1>
 <div id="version">v2.1.0 Beta</div>
</div>
<div id="content">
 <h2>Simple Demo</h2>
 <form id="form1" action="index.php" method="post" 
enctype="multipart/form-data">
  <p>This page demonstrates a simple usage of SWFUpload.  It uses the Queue 
Plugin to simplify uploading or cancelling all queued files.</p>
   <fieldset class="flash" id="fsUploadProgress">
   <legend>Upload Queue</legend>
   </fieldset>
  <div id="divStatus">0 Files Uploaded</div>
   <div>
    <input type="button" value="Upload file (Max 100 MB)" 
onclick="swfu.selectFiles()" style="font-size: 8pt;" />
    <input id="btnCancel" type="button" value="Cancel All Uploads" 
onclick="swfu.cancelQueue();" disabled="disabled" style="font-size: 8pt;" />
   </div>
 </form>
</div>
</body>
</html>
upload.php contiene il seguente codice:
<?php
/ Code for Session Cookie workaround
 if (isset($_POST["PHPSESSID"])) {
  session_id($_POST["PHPSESSID"]);
 } else if (isset($_GET["PHPSESSID"])) {
  session_id($_GET["PHPSESSID"]);
 }
 session_start();
 $POST_MAX_SIZE = ini_get('post_max_size');
 $unit = strtoupper(substr($POST_MAX_SIZE, -1));
 $multiplier = ($unit == 'M' ? 1048576 : ($unit == 'K' ? 1024 : ($unit == 
'G' ? 1073741824 : 1)));
 if ((int)$_SERVER['CONTENT_LENGTH'] > $multiplier*(int)$POST_MAX_SIZE && 
$POST_MAX_SIZE) {
  header("HTTP/1.1 500 Internal Server Error");
  echo "POST exceeded maximum allowed size.";
  exit(0);
 }
// Settings
 $save_path = getcwd() . "/swfupload/";    // The path were we will save the 
file (getcwd() may not be reliable and should be tested in your environment)
 $upload_name = "Filedata";
 $max_file_size_in_bytes = 
2147483647
;    // 2GB in bytes
 $extension_whitelist = array("jpg", "gif", "png"); // Allowed file 
extensions
 $valid_chars_regex = '.A-Z0-9_ !@#$%^&()+={}\[\]\',~`-';    // Characters 
allowed in the file name (in a Regular Expression format)
// Other variables
 $MAX_FILENAME_LENGTH = 260;
 $file_name = "";
 $file_extension = "";
 $uploadErrors = array(
        0=>"There is no error, the file uploaded with success",
        1=>"The uploaded file exceeds the upload_max_filesize directive in 
php.ini",
        2=>"The uploaded file exceeds the MAX_FILE_SIZE directive that was 
specified in the HTML form",
        3=>"The uploaded file was only partially uploaded",
        4=>"No file was uploaded",
        6=>"Missing a temporary folder"
 );
// Validate the upload
 if (!isset($_FILES[$upload_name])) {
  HandleError("No upload found in \$_FILES for " . $upload_name);
  exit(0);
 } else if (isset($_FILES[$upload_name]["error"]) && 
$_FILES[$upload_name]["error"] != 0) {
  HandleError($uploadErrors[$_FILES[$upload_name]["error"]]);
  exit(0);
 } else if (!isset($_FILES[$upload_name]["tmp_name"]) || 
!@is_uploaded_file($_FILES[$upload_name]["tmp_name"])) {
  HandleError("Upload failed is_uploaded_file test.");
  exit(0);
 } else if (!isset($_FILES[$upload_name]['name'])) {
  HandleError("File has no name.");
  exit(0);
 }
 $file_size = @filesize($_FILES[$upload_name]["tmp_name"]);
 if (!$file_size || $file_size > $max_file_size_in_bytes) {
  HandleError("File exceeds the maximum allowed size");
  exit(0);
 }
 if ($file_size <= 0) {
  HandleError("File size outside allowed lower bound");
  exit(0);
 }
 $file_name = preg_replace('/[^'.$valid_chars_regex.']|\.+$/i', "", 
basename($_FILES[$upload_name]['name']));
 if (strlen($file_name) == 0 || strlen($file_name) > $MAX_FILENAME_LENGTH) {
  HandleError("Invalid file name");
  exit(0);
 }
 if (file_exists($save_path . $file_name)) {
  HandleError("File with this name already exists");
  exit(0);
 }
 $path_info = pathinfo($_FILES[$upload_name]['name']);
 $file_extension = $path_info["extension"];
 $is_valid_extension = false;
 foreach ($extension_whitelist as $extension) {
  if (strcasecmp($file_extension, $extension) == 0) {
   $is_valid_extension = true;
   break;
  }
 }
 if (!$is_valid_extension) {
  HandleError("Invalid file extension");
  exit(0);
 }
 if (!@move_uploaded_file($_FILES[$upload_name]["tmp_name"], 
$save_path.$file_name)) {
  HandleError("File could not be saved.");
  exit(0);
 }
 echo "File Received";
 exit(0);
function HandleError($message) {
 header("HTTP/1.1 500 Internal Server Error");
 echo $message;
}
?>
dove sbaglio?

Marco scriveva il 16/02/2009 :

Prova questo:
http://the-stickman.com/files/mootools/multiupload/
-- 
Lello Vitello cantautore alla bona
www.lellovitello.it


non si riescono a selezionare piu files contemporaneamente