tolles uploadscript

speedone

New Member
Ich habe ein sehr schönes Uploadscript gefunden:

digitarald.de » Playground - Widget Birthplace

Ich versuche seit Stunden dieses Script zum laufen zu bringen. Ich habe die genaue Verzeichnisstruktur eingehalten, habe die Java Klassen heruntergeladen und denke ich auch richtig verlinkt. Auf der Page sagen die, dass man versuchen kann denen ihre Beispiel .html herunterzuladen.(den Quelltext kopiert) Das habe ich auch gemacht und dann eben die Struktur beibehalten.

Solangsam bin ich am verzweifeln

Die angehängte Grafik zeigt meine Uploadpage, bei mir kann man nur ein File Durchsuchen, auf der Hersteller Website kann man schön markieren, was geuploadet werden soll.

Hier noch meine Upload Seite:
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

	<title>digitarald.de » Playground - Widget Birthplace</title>
	<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" />
	<script type="text/javascript" src="../workspace/js/build/"></script>

	<script type="text/javascript" src="swiff/Swiff.Base.js"></script>

	<script type="text/javascript" src="swiff/Swiff.Uploader.js"></script>
	<script type="text/javascript" src="js/FancyUpload.js"></script>

	<style type="text/css">

		/**
		 * You don't need this css part, scroll down ;)
		 */

		.halfsize
		{
			width:					48%;
			margin-right:			5px;
			float:					left;
		}
		form fieldset
		{
			border:					none;
			border-top:				1px solid #888;
			margin:					1em 0.5em 1em 0;
			padding:				1em 0;
		}

		form legend
		{
			font-weight:			bold;
			font-size:				1.2em;
			color:					#888;
			margin:					auto;
			margin-left:			0;
			padding:				0 .25em 0 0;
		}
		label
		{
			width:					10em;
			float:					left;
			padding:				.2em .8em 0 0;
			margin-right:			.4em;
			text-align:				right;
			font-size:				1.1em;
		}
		label.error
		{
			color:					#ff0000;
		}

		label span
		{
			display:				block;
			color:					#888;
			font-size:				0.85em;
			margin-bottom:			0.5em;
		}
		form div.label,
		form div.note,
		form div.footer
		{
			clear:					both;
			margin:					1em 0 0 0;
			padding:				0.1em 0.3em;
		}

		form div.note
		{
			margin-left:			.5em;
		}
		input,
		button,
		select
		{
			width:					10em;
		}
		input.submit
		{
			font-weight:			bold;
			color:					#333;
			width:					auto;
			padding-right:			6px;
			padding-left:			6px;
		}


		/**
		 * Thats the basic css needed for the upload bars
		 */

		.photoupload-queue
		{
			list-style:				none;
		}
		.photoupload-queue li
		{
			background:				url(images/photo_upload.png) no-repeat 0 5px;
			padding:				5px 0 5px 22px;
		}

		.photoupload-queue .queue-file
		{
			font-weight:			bold;
		}

		.photoupload-queue .queue-size
		{
			color:					#aaa;
			margin-left:			1em;
			font-size:				0.9em;
		}

		.photoupload-queue .queue-loader
		{
			position:				relative;
			margin:					3px 15px;
			font-size:				0.9em;
			background-color:		#ddd;
			color:					#fff;
			border:					1px inset #ddd;
		}
		.photoupload-queue .queue-subloader
		{
			text-align:				center;
			position:				absolute;
			background-color:		#81B466;
			height:					100%;
			width:					0%;
			left:					0;
			top:					0;
		}

		.photoupload-queue .input-delete
		{
			width:					16px;
			height:					16px;
			background:				url(images/delete.png) no-repeat 0 0;
			text-decoration:		none;
			border:					none;
			float:					right;
		}
	</style>

	<script type="text/javascript">
		//<![CDATA[

		/**
		 * Sample Data
		 */

		window.addEvent('load', function()
		{
			/**
			 * We take the first input with this class we can find ...
			 */
			var input = $('photoupload-filedata-1');

			/**
			 * Simple and easy
			 * 
			 * swf: the path to the swf
			 * container: the object is embedded in this container (default: document.body)
			 * 
			 * NOTE: container is only used for the first uploader u create, all others depend
			 * on the same swf in that container, so the container option for the other uploaders
			 * will be ignored.
			 * 
			 */
			var uplooad = new FancyUpload(input, {
				swf: 'swiff/Swiff.Uploader.swf',
				queueList: 'photoupload-queue',
				container: $E('h1')
			});

			/**
			 * We create the clear-queue link on-demand, since we don't know if the user has flash/javascript.
			 * 
			 * You can also create the complete xhtml structure thats needed for the queue here, to be sure
			 * that its only in the document when the user has flash enabled.
			 */
			$('photoupload-status').adopt(new Element('a', {
				href: 'javascript:void(null);',
				events: {
					click: uplooad.clearList.bind(uplooad, [false])
				}
			}).setHTML('Clear Completed'));


			/**
			 * Second, this one uses the already injected swf embed to upload files.
			 */
			var uplooad2 = new FancyUpload($('photoupload2-filedata-1'), {
				swf: 'swiff/Swiff.Uploader.swf',
				queueList: 'photoupload-queue-2'
			});
		});

		//]]>
	</script>

</head>
<body>

	<div id="container">
		<h1>
			<a href="/playground/" title="Playground Index">moo.Playground</a>
		</h1>

		<h2>
			<a href="/project/fancyupload/" title="Project Details">FancyUpload <small>using MooTools (Released, Download and details here!)</small></a>
		</h2>

		<p>
			<strong>Swf meets Ajax</strong> for beautiful uploads. The release of the long awaited MooTools upload widget thats allows queued multiple-file upload including progress bars.<br />
			Fully compatible with all A-Grade Browsers and Flash 8+ (Internet Explorer 6+, Opera 9, Firefox 1.5+ and Safari 2+)
		</p>

		<p>
			Uploaded files are not saved, only logged to control the traffic. <a href="/playground/server/upload.phps">PHP source code</a>.
			The upload backend validates the uploaded file. It has to be an image (GIF, PNG, JPG or TIFF) and bigger than 25x25 pixels.
		</p>


		<form action="/playground/server/upload.php" method="post" id="photoupload" enctype="multipart/form-data">
			<div class="halfsize">
				<fieldset>
					<legend>Select Files</legend>

					<div class="note">
						Photos will be uploaded in a queue, upload them with one click.<br />

						Selected Options: <b>Filetype Only Images, select multiple files, <i>upload queued</i></b>.
					</div>

					<div class="label emph">
						<label for="photoupload-filedata-1">
							Upload Photos:
							<span>After selecting the photos start the upload.</span>
						</label>

						<input type="file" name="Filedata" id="photoupload-filedata-1" />
					</div>

				</fieldset>
			</div>
			<div class="halfsize">
				<fieldset>
					<legend>Upload Queue</legend>

					<div class="note" id="photoupload-status">
						Check the selected files and start uploading.
					</div>

					<ul class="photoupload-queue" id="photoupload-queue">
						<li style="display: none" />
					</ul>
				</fieldset>
			</div>

			<div class="clear"></div>

			<div class="footer">
				<input type="submit" class="submit" id="profile-submit" value="Start Upload"/>
			</div>
		</form>

		<br />

		<h3>Second form <small>(You can insert an unlimited amount)</small></h3>


		<form action="/playground/server/upload.php" method="post" id="photoupload2" enctype="multipart/form-data">
			<div class="halfsize">
				<fieldset>
					<legend>Select Files II</legend>

					<div class="label emph">
						<label for="photoupload2-filedata-1">
							Upload Photos:
							<span>After selecting the photos start the upload.</span>

						</label>
						<input type="file" name="Filedata" id="photoupload2-filedata-1" />
					</div>

				</fieldset>
			</div>
			<div class="halfsize">
				<fieldset>
					<legend>Upload Queue</legend>

					<ul class="photoupload-queue" id="photoupload-queue-2">
						<li style="display: none" />
					</ul>
				</fieldset>
			</div>

			<div class="clear"></div>

			<div class="footer">

				<input type="submit" class="submit" id="profile-submit-2" value="Start Upload"/>
			</div>
		</form>

		<div style="margin-left:-14px; margin-top: 20px;">
			<script type="text/javascript"><!--
			google_ad_client = "pub-0765703537118513";
			google_ad_width = 728;
			google_ad_height = 90;
			google_ad_format = "728x90_as";
			google_ad_type = "text";
			//2007-07-18: digitarald.de/playground
			google_ad_channel = "6312347254";
			google_color_border = "dddddd";
			google_color_bg = "FFFFFF";
			google_color_link = "E65551";
			google_color_text = "000000";
			google_color_url = "519EE6";
			google_ui_features = "rc:10";
			//-->
			</script>
			<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
		</div>

		<div style="text-align: center; margin-top: 100px;">
			&copy; 2006 by <a href="../about/">Harald Kirschner</a> aka <a href="../">digitarald</a><br />
			The contents of this website are licensed under <a href="http://www.opensource.org/licenses/mit-license.php">MIT-License</a>
		</div>

	</div>
	<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
	<script type="text/javascript">
	_uacct = "UA-601848-2";
	urchinTracker();
	</script>
</body>
</html>

Ich hoffe, dass da jemand durchblickt
 

Attachments

  • falsch.jpg
    falsch.jpg
    85.8 KB · Views: 162
So per Ferndiagnose würde ich behaupten, dass eine oder mehrere der Javascriptdateien nicht eingebunden sind. Auf der Originalwebseite werden die Formularfelder via AJAX(Javascript) manipuliert.

P.S.
Bitte nie Java mit Javascript verwechseln, dass sind zwei verschiedene Dinge. ;)
 
Wieso so ein elendig langes Script verwenden. Sind doch nur ein paar Zeilen in PHP und schon hat man ein UploadScript.
 
Ich habe das Problem mittlerweile gelöst. Das Upload Script hatte noch zwei Javascript Dateien gebraucht von Mootools. Leider stand das nicht auf der Seite.
Außerdem musste man noch eine php Dateien ändern, die dafür zuständig ist das File zu speichern und z. B noch duch ein paar Bedinungen (Größe, Fileart...)
den Upload einzuschränken

Zu der Frage warum nicht ein kleineres Script nutzen

Dieses Script bietet viele Features, die je nach Verwendungszweck sehr praktisch sind.

-Kein sichtbarer Seitenrefresh -> Ajax
-Einen Uploadstatus ohne php extensions -> Flash, Javascript
-Da das Fenster zum Selektieren von Dateien modifiziert wurde, lassen sich bequem mehrere Files markieren und diese werden sofort aufgelistet -> werden dann nach der Reihe hochgeladen mit jedem File eigener Uploadstatus.

Kann z. B für einen Bilderupload sehr gut sein, wenn man kein Java Applet benutzen möchte(das meistens etwas kostet)
 
Back
Top