Ergebnis 1 bis 4 von 4

Thema: Fields file in BLOB

  1. #1
    Contao-Nutzer
    Registriert seit
    28.06.2010.
    Ort
    Frankreich
    Beiträge
    29

    Standard Fields file in BLOB

    Hi,

    How are encrypted fields "file" metamodel? Blob ?

    Because I have to make a query in a php file and I can not display the URL of the file filled in the metamodel catalog.
    PHP-Code:
    $sql "SELECT CONVERT(file USING utf8) fileutf8 FROM mm_table WHERE .....";
    ...
    ...
    $data mysql_fetch_assoc($result);
    echo 
    "File : "$file $data['fileutf8']; 
    I have a "id".
    But the "id" don't have a link with the good files in table of contao tl_files !
    Geändert von tom-over (15.10.2015 um 16:41 Uhr)

  2. #2
    Alter Contao-Hase Avatar von Messa
    Registriert seit
    19.01.2011.
    Ort
    Vorarlberg, Österreich
    Beiträge
    1.423

    Standard

    This post should help you

    https://community.contao.org/de/show...l=1#post333333

    For Blob:
    Code:
    $image = deserialize($blob);
    For Uuid:

    Code:
    $image =  \FilesModel::findByUuid($uuid)->path;
    For Id:

    Code:
    $image =  \FilesModel::findByPk($id)->path;
    Best regards
    Matthias
    Geändert von Messa (15.10.2015 um 18:19 Uhr)
    Full Service Agentur - Grafikdesign, Screendesign, Webdesign, Webentwicklung, SEO, Weiterbildung, persönliches Coaching
    http://www.matthiasgmeiner.com

  3. #3
    Contao-Nutzer
    Registriert seit
    28.06.2010.
    Ort
    Frankreich
    Beiträge
    29

    Standard

    Thank you.

    But I don't understand because is not the good file is read ! ? !

    PHP-Code:
    echo "File : ".serialize($file); 
    Result = s:2:"9";

    The id '9' is a not a good file

    I don't understand why...

  4. #4
    Contao-Urgestein Avatar von do_while
    Registriert seit
    15.06.2009.
    Ort
    Berlin | Deutschland
    Beiträge
    3.614
    Partner-ID
    1081
    User beschenken
    Wunschliste
    Contao-Projekt unterstützen

    Support Contao

    Standard

    Because, if there is a multiple checkbox or select field, then it is a serializied array of the checked/selected IDs.

Aktive Benutzer

Aktive Benutzer

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)

Lesezeichen

Lesezeichen

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •