PSD-Tutorials.de
Forum für Design, Fotografie & Bildbearbeitung
Tutkit
Agentur
Hilfe
Kontakt
Start
Forum
Aktuelles
Besonderer Inhalt
Foren durchsuchen
Tutorials
News
Anmelden
Kostenlos registrieren
Aktuelles
Suche
Suche
Nur Titel durchsuchen
Von:
Menü
Anmelden
Kostenlos registrieren
App installieren
Installieren
JavaScript ist deaktiviert. Für eine bessere Darstellung aktiviere bitte JavaScript in deinem Browser, bevor du fortfährst.
Du verwendest einen veralteten Browser. Es ist möglich, dass diese oder andere Websites nicht korrekt angezeigt werden.
Du solltest ein Upgrade durchführen oder einen
alternativen Browser
verwenden.
Antworten auf deine Fragen:
Neues Thema erstellen
Start
Forum
Sonstiges
Webdesign, Webentwicklung & Programmierung
Webdesign: HTML/CSS, Responsive Design, Sass...
Hilfe bei Dropbox PHP Script
Beitrag
<blockquote data-quote="Foos" data-source="post: 1575392" data-attributes="member: 72189"><p><strong>AW: Hilfe bei Dropbox PHP Script</strong></p><p></p><p>[PHP]<html></p><p> <head></p><p> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></p><p> <title>Dropbox Uploader Demo</title></p><p> </head></p><p></p><p><style></p><p>h1{}</p><p>body{font-family:arial;font-size:13px;}</p><p>.box{</p><p>background:none repeat scroll 0 0 #F6F6F6;</p><p>border:1px solid #C3C3C3;</p><p>margin-left:100px;</p><p>margin-top:50px;</p><p>width:860px;</p><p>}</p><p>.message{</p><p>background-color:#FFFFE0;</p><p>border:1px solid #E6DB55;</p><p>margin:30px 0 16px 8px;</p><p>padding:12px;</p><p>width:774px;</p><p>}</p><p></style></p><p><body></p><p><?php</p><p>if ($_POST) {</p><p> require 'DropboxUploader.php';</p><p></p><p></p><p> try {</p><p> // Rename uploaded file to reflect original name</p><p> if ($_FILES['file']['error'] !== UPLOAD_ERR_OK)</p><p> throw new Exception('File was not successfully uploaded from your computer.');</p><p></p><p> $tmpDir = uniqid('/tmp/DropboxUploader-');</p><p> if (!mkdir($tmpDir))</p><p> throw new Exception('Cannot create temporary directory!');</p><p></p><p> if ($_FILES['file']['name'] === "")</p><p> throw new Exception('File name not supplied by the browser.');</p><p></p><p> $tmpFile = $tmpDir.'/'.str_replace("/\0", '_', $_FILES['file']['name']);</p><p> if (!move_uploaded_file($_FILES['file']['tmp_name'], $tmpFile))</p><p> throw new Exception('Cannot rename uploaded file!');</p><p></p><p> // Enter your Dropbox account credentials here</p><p> $uploader = new DropboxUploader('you@youremail.com', 'password');</p><p> $uploader->upload($tmpFile, $_POST['dest']);</p><p></p><p> echo '<span style="color: green;font-weight:bold;margin-left:393px;">File successfully uploaded to my Dropbox!</span>';</p><p> } catch(Exception $e) {</p><p> echo '<span style="color: red;font-weight:bold;margin-left:393px;">Error: ' . htmlspecialchars($e->getMessage()) . '</span>';</p><p> }</p><p></p><p> // Clean up</p><p> if (isset($tmpFile) && file_exists($tmpFile))</p><p> unlink($tmpFile);</p><p></p><p> if (isset($tmpDir) && file_exists($tmpDir))</p><p> rmdir($tmpDir);</p><p>}</p><p>?></p><p><div class="box" align="center"></p><p> <h1>Dropbox Uploader Demo<br></p><p> <br></p><p> &nbsp;</h1></p><p> <form method="POST" enctype="multipart/form-data"></p><p> <input type="file" name="file" /><br><br></p><p> <input type="submit" value="Upload the file to my Dropbox!" /></p><p> <input style="display:none" type="text" name="dest" value="kunde" /></p><p></p><p></div></p><p></p><p></p><p></p><p></p><p></body></p><p></html></p><p>[/PHP]</p></blockquote><p></p>
[QUOTE="Foos, post: 1575392, member: 72189"] [b]AW: Hilfe bei Dropbox PHP Script[/b] [PHP]<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Dropbox Uploader Demo</title> </head> <style> h1{} body{font-family:arial;font-size:13px;} .box{ background:none repeat scroll 0 0 #F6F6F6; border:1px solid #C3C3C3; margin-left:100px; margin-top:50px; width:860px; } .message{ background-color:#FFFFE0; border:1px solid #E6DB55; margin:30px 0 16px 8px; padding:12px; width:774px; } </style> <body> <?php if ($_POST) { require 'DropboxUploader.php'; try { // Rename uploaded file to reflect original name if ($_FILES['file']['error'] !== UPLOAD_ERR_OK) throw new Exception('File was not successfully uploaded from your computer.'); $tmpDir = uniqid('/tmp/DropboxUploader-'); if (!mkdir($tmpDir)) throw new Exception('Cannot create temporary directory!'); if ($_FILES['file']['name'] === "") throw new Exception('File name not supplied by the browser.'); $tmpFile = $tmpDir.'/'.str_replace("/\0", '_', $_FILES['file']['name']); if (!move_uploaded_file($_FILES['file']['tmp_name'], $tmpFile)) throw new Exception('Cannot rename uploaded file!'); // Enter your Dropbox account credentials here $uploader = new DropboxUploader('you@youremail.com', 'password'); $uploader->upload($tmpFile, $_POST['dest']); echo '<span style="color: green;font-weight:bold;margin-left:393px;">File successfully uploaded to my Dropbox!</span>'; } catch(Exception $e) { echo '<span style="color: red;font-weight:bold;margin-left:393px;">Error: ' . htmlspecialchars($e->getMessage()) . '</span>'; } // Clean up if (isset($tmpFile) && file_exists($tmpFile)) unlink($tmpFile); if (isset($tmpDir) && file_exists($tmpDir)) rmdir($tmpDir); } ?> <div class="box" align="center"> <h1>Dropbox Uploader Demo<br> <br> </h1> <form method="POST" enctype="multipart/form-data"> <input type="file" name="file" /><br><br> <input type="submit" value="Upload the file to my Dropbox!" /> <input style="display:none" type="text" name="dest" value="kunde" /> </div> </body> </html> [/PHP] [/QUOTE]
Bilder bitte
hier hochladen
und danach über das Bild-Icon (Direktlink vorher kopieren) platzieren.
Zitate einfügen…
Authentifizierung
Wenn ★ = 12, ◇ = 4 und die Hälfte von ★ zu ◇ addiert wird, was ist das Ergebnis?
Antworten
Start
Forum
Sonstiges
Webdesign, Webentwicklung & Programmierung
Webdesign: HTML/CSS, Responsive Design, Sass...
Hilfe bei Dropbox PHP Script
Oben