php.de

Zurück   php.de > Webentwicklung > PHP Einsteiger > PHP Tipps 2005-2

 
 
LinkBack Themen-Optionen Thema bewerten
Alt 01.07.2005, 11:13  
Gast
 
Beiträge: n/a
Standard PDF Upload!???

Morgen an alle,

Ich habe folgendes Problem.

Ich habe ein Formular mit dem ich PDF's uploaden kann (hoffe ich drücke mich halbwegs verständlich aus) sinn und zweck dieses Uploads

Ich fülle ein INFO-Formular aus bekomme auf dieses INFO-Formular eine Antwort auf die Angegebene Adresse mit eben diesem PDF - Anhang

Kann mir jemand einen Tipp geben wäre echt klasse

Code:
<?
   require_once( "../inc/inc/pms.conf" );
   require_once( "../inc/utils.php" );
   require_once( "../inc/dbconnect.php" );
   require_once( "../inc/admform.php" );
   require_once( "../inc/dblist.php" );
   require_once( "../inc/navi.php" );


$db = new dbconnect;
//$db -> debug = true;

if ( $actionfield=="delete" )
{
    $db -> dbquery( "select * from ".TAB_PDF." where id=".max( $id, $data['id'] ) );
    $row = $db -> fetch();
    $name = $row['name'];
    unlink( "../kontaktinfos/$name" );
    $db -> dbquery( "delete from ".TAB_PDF." where id=".max( $id, $data['id']) );
    forward( $GLOBALS['PHP_SELF'] );
}
if ( $actionfield=="save" )


   {
      if ( copy( $_FILES['data']['tmp_name']['artfile'], "../kontaktinfos/".$_FILES['data']['name']['artfile'] ) )  
      {
          $data['name'] = $_FILES['data']['name']['artfile'];
	  $db -> makeInsert( TAB_PDF, $data );
          forward( $GLOBALS['PHP_SELF'] );
      }
      else
      {
        print( "<font color='red'>Ihre Datei konnte nicht kopiert werden. Bitte informieren Sie den Sysadmin</font>" );
      }
   }
?>
<link href='/adminstyles/styles.css' rel='stylesheet' type='text/css'>
<?
if ( $data['id'] or $id )
{
   $data = $db -> fetch_by_id( TAB_PDF, max($data['id'], $id) );
}
$list = new dbadmlist( $db, TAB_PDF);
$list->setHeading( "Name" );
$list->setOutputCols( "name" );
$list->setEditor( $GLOBALS['PHP_SELF'] );
$list->find( $find_array, $suche );
//  $list->setOrder( "name, vorname, ort" );
$list->searchfield_show = true;
$list->setOrder( "name" );
$list->createOutput();

$form = new admform( "data", "" );
$form->hidden( "id" );
$form->hidden("suche");
$form->addButton( "save", true, "submit", "", "Speichern" );
if ( $id or $data['id'] )
{
   $form->addButton( "delete", true, "submit", "", "Löschen" );
}

$form->addGroup( "PDF Upload ".$data['name'], "std", "Hier werden PDF upgeloadet." );  $form->addItem( "artfile", "PDF-datei", "std", "file", "" ); 

$form->create();
?>
"Wenn ich die PDF ausgewählt habe und dann den Button PDF Upload anklicke passiert gar nichts "
kann mir vielleicht jemand sagen wo der Fehler liegt

Vielen Dank
 
Sponsor Mitteilung
PHP Code Flüsterer

Registriert seit: 21.08.2005
Beiträge: 4682
PHP-Kenntnisse:
Fortgeschritten

Alt 01.07.2005, 11:20  
Gast
 
Beiträge: n/a
Standard

Zitat:
den Code reinziehen
Echt krasser Code, hab ihn mir durch die Nase gezogen ...

Hmmm, copy() benutze ich nicht so gerne, bevorzuge move_upload() ...

EDIT:

Wo kommt eigentlich artfile her ?
 
Alt 01.07.2005, 11:26  
Gast
 
Beiträge: n/a
Standard

Naja so war das nicht gemeint

also wenn ich das richtig verstehe anstatt:
Code:
{
      if ( copy( $_FILES['data']['tmp_name']['artfile'], "../kontaktinfos/".$_FILES['data']['name']['artfile'] ) )  
      {
          $data['name'] = $_FILES['data']['name']['artfile'];
	  $db -> makeInsert( TAB_PDF, $data );
          forward( $GLOBALS['PHP_SELF'] );
      }
      else
      {
        print( "<font color='red'>Ihre Datei konnte nicht kopiert werden. Bitte informieren Sie den Sysadmin</font>" );
      }
   }
so:
Code:
{
      if ( move_upload( $_FILES['data']['tmp_name']['artfile'], "../kontaktinfos/".$_FILES['data']['name']['artfile'] ) )  
      {
          $data['name'] = $_FILES['data']['name']['artfile'];
	  $db -> makeInsert( TAB_PDF, $data );
          forward( $GLOBALS['PHP_SELF'] );
      }
      else
      {
        print( "<font color='red'>Ihre Datei konnte nicht kopiert werden. Bitte informieren Sie den Sysadmin</font>" );
      }
   }
[/code]
 
Alt 01.07.2005, 11:29  
Gast
 
Beiträge: n/a
Standard

> $_FILES['data']['tmp_name']['artfile']

Damit kann ich nichts anfangen.
Was ist artfile ?

Eigentlich ist das Ding nur: $_FILES['data']['tmp_name']
 
Alt 01.07.2005, 11:30  
Gast
 
Beiträge: n/a
Standard

Es müsste doch wenigstens die Fehlermeldung auftauchen aber es passiert gar nichts der Button Funktioniert anscheinend nicht
Ich weiß auch gar nicht wo ich ansetzen soll keine Fehlermeldung keine Reaktion in irgend einer art und weiße gar nichts
 
Alt 01.07.2005, 11:37  
Gast
 
Beiträge: n/a
Standard

Ach jetzt sehe ich erst wo das herkommt

Haste mal var_dump($_FILES); versucht ?
Und bei $actionfield kommt auch "save" an ?
 
 


Themen-Optionen
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
Upload Script + Multible Server cyberstorm PHP Tipps 2006 5 11.10.2006 19:43
upload system ... upload geht nicht ? maTu PHP Tipps 2006 3 25.03.2006 11:24
Mediawiki: upload auch für zipdateien !? Alpha Centauri PHP-Fortgeschrittene 6 20.01.2006 08:46
[Erledigt] Automatische benachrichtigung an den Admin nach User Upload PHP Tipps 2007 3 12.12.2005 21:25
Upload Kevin PHP Tipps 2005-2 5 13.10.2005 21:19
FTP upload PHP Tipps 2005-2 2 17.08.2005 11:43
Ansichtsproblem beim Upload Off-Topic Diskussionen 2 17.04.2005 21:11
ftp upload per get Matthiasnet PHP Tipps 2005 6 08.03.2005 19:30
[Erledigt] &quot;The directory you set for upload work cannot be reache PHP Tipps 2005 5 07.02.2005 12:19
Was stimmt mit meinem Upload nicht? Calli PHP Tipps 2004-2 6 21.12.2004 12:54
Ich bin auf der Suche nach einem fertigen Menü Upload Script Beitragsarchiv 7 22.08.2004 18:53
[Erledigt] Wie erstelle ich ein Upload Menü mit mehreren Menüpunkten ? PHP Tipps 2004 3 22.08.2004 14:19
PHP Upload Dateigröße ermitteln? PHP Tipps 2004 9 22.08.2004 13:48
[Erledigt] Php skript upload problem! PHP Tipps 2004 2 30.06.2004 00:06
[Erledigt] File Upload: PRoblem mit Upload directory PHP Tipps 2004 3 26.06.2004 13:20

Besucher kamen über folgende Suchanfragen bei Google auf diese Seite
php pdf upload, pdf upload php, php pdf hochladen und speichern, phppdf upload, php upload formular pdf, formular pdf upload, dateien pdf hochladen php, php pdf uploaden loeschen, php formular pdf upload, php pdf upload in db, php pdf upload script, php upload pdf, pdf upload php mit namen geben, formular mehrere pdf upload php, pdf upload auf server php, pdf upload script

Alle Zeitangaben in WEZ +2. Es ist jetzt 04:42 Uhr.




Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Aprilia-Forum, Aquaristik-Forum, Liebeskummer-Forum, Zierfisch-Forum, Geizkragen-Forum

Creative Commons License
Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.