Zum Inhalt springen

Ext "fileupload" und PNG

Erstellt am 10. Oktober 2006 · 5 Antworten · letzte Antwort am 31. Juli 2007

Tags: Datei-Upload, Frage

Danii ·

Moin,

ich möchte dem User mit der Extension "fileupload" ermöglichen seine Urlaubsbilder in einen vordefinierten Ordner zu uploaden und in die "goof_fotoboek" zu integrieren.

Da "goof_fotoboek" eigentlich nur .jpg unterstützt, kann ich soweit alle Dateien ausschliessen - ausser PNG.
Da kann ich machen was ich will, PNG-Dateien werden hochgeladen. Von der Sytax her sollte es aber passen.

Fällt jemanden von euch was auf was ich vergessen habe?

Hier mein TS

plugin.tx_fileupload_pi1{

checkMime = 1
mimeExclude = image/gif, image/png, application/x-zip-compressed, application/octet-stream
mimeInclude = *

	checkExt = 1
	extExclude = txt,htm,html,exe,php,php3
	extInclude = *
	maxsize = 600000
	#path = fileadmin/
                path = fileadmin/Bildergalerie_Guest/
	FEuserHomePath=1
	FEuserHomePath.field = username
	noOverwrite = 1
	fileMode = 0755
	_CSS_DEFAULT_STYLE (

	)
	_LOCAL_LANG.default {

	}
	_DEFAULT_PI_VARS {

	}

	#	This cObject must contain the upload-form
	#
	#	The upload form must at least contain the following:
	#
	#	a) an input field of type "file" and name "tx_fileupload_pi1"
	#	b) an input field of type "submit" and name "tx_fileupload_pi1[do_upload]"
	#
	#	If you insert the marker ###STATUS### it will be replaced by any status messages that was generated
	#	following an upload
	#

	uploadformcObject = TEXT
	uploadformcObject.insertData = 1
	uploadformcObject.value(
                                     <form enctype="multipart/form-data" method="POST">
                                     <input type="hidden" name="MAX_FILE_SIZE" value="500000" />
                                     <input name="tx_fileupload_pi1" type="file" /><input type="submit" name="tx_fileupload_pi1[do_upload]" value="{LLL:EXT:fileupload/pi1/locallang.php:submitupload}" />
                                     <div class="alert">###STATUS### </div>
	)


	#	These are the status messages that can be displayed after an upload request has been processed

	message{

		#File already exists on server
		exist = TEXT
		exist.value = <p>{LLL:EXT:fileupload/pi1/locallang.php:error.exist}</p>
		exist.insertData = 1


		#File too big
		toobig = TEXT
		toobig.value = <p>{LLL:EXT:fileupload/pi1/locallang.php:error.toobig}</p>
		toobig.insertData = 1

		#Mime type not allowed
		mimenotallowed = TEXT
		mimenotallowed.value = <p>{LLL:EXT:fileupload/pi1/locallang.php:error.mimenotallowed}</p>
		mimenotallowed.insertData = 1

		#File extension not allowed
		extensionnotallowed = TEXT
		extensionnotallowed.value = <p>{LLL:EXT:fileupload/pi1/locallang.php:error.extensionnotallowed}</p>
		extensionnotallowed.insertData = 1

		#Upload was succesfull
		uploadsuccesfull = TEXT
		uploadsuccesfull.value = <p>{LLL:EXT:fileupload/pi1/locallang.php:uploadsuccesfull}</p>
		uploadsuccesfull.insertData = 1

		#File was only partially uploaded
		partial = TEXT
		partial.value = <p>{LLL:EXT:fileupload/pi1/locallang.php:error.partial}</p>
		partial.insertData = 1

		#No file was uploaded
		nofile = TEXT
		nofile.value = <p>{LLL:EXT:fileupload/pi1/locallang.php:error.nofile}</p>
		nofile.insertData = 1

		#Unknown error
		unknown = TEXT
		unknown.value = <p>{LLL:EXT:fileupload/pi1/locallang.php:error.unknown}</p>
		unknown.insertData = 1
	}
}
Danii ·

Ich versuche jetzt mal den einzigen Schwubbsversuch :o

Hat keiner eine Idee warum PNG's hochgeladen werden dürfen?

Danii ·

Tja, wirklich weiter gekommen bin ich nicht, allerdings hat sich ein neues Problem aufgetan. ich kann keine grösseren Dateien hochjagen. Bei einer Dateigrösse von 1.5 MB jammert die EXT

Upload fehlgeschlagen! Die angegebene Datei ist zu gross.

im TS hab ich die maxSize aber hochgesetzt

checkExt = 1
	extExclude = txt, htm,html,exe,php,php3
	extInclude = *
        ## hier hab ich die Groesse hoch gesetzt
        maxsize = 20971520
        path = fileadmin/Bildergalerie/
	FEuserHomePath=1
	FEuserHomePath.field = username
	noOverwrite = 1
	fileMode = 0755

auch in der xetTables.php hab ich die Grössen hochgesetzt (dürfte aber nix ausmachen)

$GLOBALS['TCA']['tt_content']['columns']['media']['config']['max_size'] = 20971520;
$GLOBALS['TCA']['tt_content']['columns']['image']['config']['max_size'] = 20971520;

aber nix ändert sich.

Bitte - hat von euch noch jemand eine Idee wo ich schrauben könnte?

elv1s ·

Hallo,

also ich habe es hinbekommen in dem ich im Setup folgendes habe

plugin.tx_fileupload_pi1.checkMime = 0
plugin.tx_fileupload_pi1.mimeInclude = image/gif,image/jpeg,image/jpg,application/x-zip-compressed
plugin.tx_fileupload_pi1.mimeExclude = application/octet-stream
plugin.tx_fileupload_pi1.checkExt = 1
plugin.tx_fileupload_pi1.extExclude = exe,php,php3
plugin.tx_fileupload_pi1.extInclude = *
plugin.tx_fileupload_pi1.FEuserHomePath=1
plugin.tx_fileupload_pi1.maxsize = 900000000
plugin.tx_fileupload_pi1.path = fileadmin/ordner/
plugin.tx_fileupload_pi1.noOverwrite = 1
plugin.tx_fileupload_pi1.fileMode = 0755
plugin.tx_fileupload_pi1.uploadformcObject = TEXT
plugin.tx_fileupload_pi1.uploadformcObject.value(

    ###STATUS###
  <form enctype="multipart/form-data" method="POST">
  <input type="hidden" name="MAX_FILE_SIZE" value="900000000">
  <input name="tx_fileupload_pi1" type="file"><br>
  <input type="submit" name="tx_fileupload_pi1[do_upload]" value="Upload!">
  </form>       
)
plugin.tx_fileupload_pi1.message{

 #File already exists on server
 exist = TEXT
 exist.value = <p>Upload failed! The file already exists.</p>

 #File too big
 toobig = TEXT
 toobig.value = <p>Upload failed! The file is too big.</p>

 #Mime type not allowed
 mimenotallowed = TEXT
 mimenotallowed.value = <p>Upload failed! This mime type is not allowed.</p>
                

 #File extension not allowed
 extensionnotallowed = TEXT
 extensionnotallowed.value = <p>Upload failed! This file extension is not allowed.</p>

 #Upload was succesfull
 uploadsuccesfull = TEXT
 uploadsuccesfull.value = <p>File was succesfully uploaded!</p>
     
 #File was only partially uploaded
 partial = TEXT
 partial.value = <p>Upload failed! The file was only partially uploaded.</p>

 #No file was uploaded
 nofile = TEXT
 nofile.value = <p>Upload failed! File not found.</p>

 #Unknown error
 unknown = TEXT
 unknown.value = <p>Upload failed! Error unknown.</p>
}

"900000000" kannst du ja selbst in Kb erfassen.

und im "PHP.INI" folgendes noch folgendes geaendert habe...

- "upload_max_filesize" = habe ich hoch gesetzt. z.B. 40M
- "post_max_size" = habe ich hoch gesetzt. z.B. 40M

Gruss
Kasper