לוגו אתר Fresh          
 
 
  אפשרות תפריט  ראשי     אפשרות תפריט  צ'אט     אפשרות תפריט  מבזקים     אפשרות תפריט  צור קשר     חץ שמאלה ‎print ‎"Hello World!"; if‎ ‎not rules.‎know ‎then rules.‎read(); חץ ימינה  

לך אחורה   לובי הפורומים > מחשבים > תכנות ובניית אתרים
שמור לעצמך קישור לדף זה באתרי שמירת קישורים חברתיים
תגובה
 
כלי אשכול חפש באשכול זה



  #1  
ישן 06-06-2006, 21:30
  ShadowMan ShadowMan אינו מחובר  
 
חבר מתאריך: 27.04.06
הודעות: 11
עזרה בקשר לשיפור מערכת העלאת קבצים.

שלום, יש לי מערכת העלאת קבצים חינמית, ואני צריך עזרה בלשפר אותה.

יש במערכת קובץ אחד (למעט הקבצי העיצוב, כגון: הלוגו, והCSS), ושמו Uploader.php

קוד שלו הוא:

קוד PHP:
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<
html>
<
head>
<
title>HD Uploader</title>
<
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<
link href="stylesheet.css" rel="stylesheet" type="text/css">
</
head>
<
body>
<
table width="100%" cellspacing="2" cellpadding="2" height="100%">
  <
tr>
    <
td>
      <
div align="center">
        <
table width="550" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#336699">
          <
tr
            <
td background="top.gif" height="60"><img src="head.gif" width="256" height="45"></td>
          </
tr>
          <
tr
            <
td background="bg.gif"><table width="100%" cellpadding="5" cellspacing="5">
                <
tr
                  <
td background="bg.gif">
                    <
form name="formen" action="uploader.php" method="post" enctype="multipart/form-data">
                      
You can upload to the foldersuploaded_picsuploaded_files 
                      
and uploaded_docs.<br>
                      
This scripts uploads only: *.jpg, *.gif *.png *.exe *.zip 
                      
*.rar and *.html<br>
                      
You must give the file a name on the server. Do not forget 
                      the ending
.<br>
                      
Max filesize1000kb. <br>
                      <
br>
                      <
table width="100%" cellspacing="2" cellpadding="2">
                        <
tr
                          <
td width="180" background="bg.gif">File: </td>
                          <
td background="bg.gif"
                            <
input type="file" name="bilde_fil">
                          </
td>
                        </
tr>
                        <
tr
                          <
td width="180" background="bg.gif">Choose folder:</td>
                          <
td background="bg.gif"
                            <
select name="folder">
                              <
option>Choose folder</option>
                              <
option value="uploaded_pics/">Uploaded Pics</option>
                              <
option value="uploaded_files/">Uploaded Files</option>
                              <
option value="uploaded_docs/">Uploaded Docs</option>
                            </
select>
                          </
td>
                        </
tr>
                        <
tr
                          <
td width="180" background="bg.gif">Name of the file 
                            on the server
:</td>
                          <
td background="bg.gif"
                            <
input type="text" name="nyttnavn">
                          </
td>
                        </
tr>
                        <
tr
                          <
td width="180" background="bg.gif">Filetype:</td>
                          <
td background="bg.gif"
                            <
select name="ending">
                              <
option>.jpg</option>
                              <
option>.png</option>
                              <
option>.gif</option>
                              <
option>.exe</option>
                              <
option>.zip</option>
                              <
option>.rar</option>
                              <
option>.ace</option>
                              <
option>.html</option>
                            </
select>
                          </
td>
                        </
tr>
                      </
table>
                      <
br>
                      <
input type="submit" value="Upload" name="submit">
                      <
input type="hidden" name="MAX_FILE_SIZE" value="1000000">
                      <?
php if ($folder == "Choose folder")
  {
  
  echo 
"<b>Error: </b> You must Choose a folder to upload your file.";
  }
?>
                      <?php
#Config
$path=$folder//The file-path(remember the last '/')
#Do not edit  below :)
if ($bilde_fil && $nyttnavn){
   
$ok 1;
   if (
is_file($path.$nyttnavn.$ending)){
      print 
"<b>Error</b>, the name allready exists. Choose another name.<br>";
      
$ok 0;
   }
   if (
preg_match("/^[\/\\\.]/"$nyttnavn)){
      print 
"<b>Error</b>, Filname can't start with: '.', '/' or '\'";
      
$ok 0;
   }
   if (!(
$ending == ".jpg" || $ending == ".gif" || $ending == ".zip" || $ending == ".exe" || $ending == ".rar" || $ending == ".html" || $ending == ".ace" || $ending == ".png")){
      print 
"<b>Error</b>, do not mix with the filename ($ending) Thanks!";
      
$ok 0;
   }
   print 
"";
}
if (
$ok){
   
$res copy($bilde_fil$path."/".$nyttnavn.$ending);
   print (
$res)?"<b>Finish</b>, uploadet ".$nyttnavn.$ending."":"<b>Error</b>, could not upload the file.<br>";
   print 
"";
}
?>
                      <font color="#FFFFFF"></font><br>
                    </form>
   
   </td>
                </tr>
              </table> </td>
          </tr>
          <tr> 
            <td height="37"> 
              <table width="100%" cellspacing="0" cellpadding="0">
                <tr> 
                  <td height="37" background="bottom.gif"> 
                    <div align="center">All Rights Reserved. <a href="http://www.harlemdesigns.org">Harlem 
                      Designs</a> are Free Softwares.<br>
                      Copyright Harlem Designs &copy;2001-2003</div>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
        <p class="headcell">&nbsp;</p>
      </div>
    </td>
  </tr>
</table>
</body>
</html> 



עכשיו, הייתי רוצה, לגרום למערכת להעלאות את הקבצים לתיקייה אחת (שלא יבחרו), ושלקובץ יהיה שם שישתנה, ושם את השם לא יבחרו.

כמו כאן:

Up-f.net


תודה רבה לעזורים!!
תגובה ללא ציטוט תגובה עם ציטוט חזרה לפורום
תגובה

כלי אשכול חפש באשכול זה
חפש באשכול זה:

חיפוש מתקדם
מצבי תצוגה דרג אשכול זה
דרג אשכול זה:

מזער את תיבת המידע אפשרויות משלוח הודעות
אתה לא יכול לפתוח אשכולות חדשים
אתה לא יכול להגיב לאשכולות
אתה לא יכול לצרף קבצים
אתה לא יכול לערוך את ההודעות שלך

קוד vB פעיל
קוד [IMG] פעיל
קוד HTML כבוי
מעבר לפורום



כל הזמנים המוצגים בדף זה הם לפי איזור זמן GMT +2. השעה כעת היא 13:58

הדף נוצר ב 0.14 שניות עם 12 שאילתות

הפורום מבוסס על vBulletin, גירסא 3.0.6
כל הזכויות לתוכנת הפורומים שמורות © 2025 - 2000 לחברת Jelsoft Enterprises.
כל הזכויות שמורות ל Fresh.co.il ©

צור קשר | תקנון האתר