Skip to content

spirit posteets tagged images

 

  • 6 years ago
    if ($request_uri ~* "\.(ico|css|js|gif|jpe?g|png)\?[0-9]+$") {
      access_log off;
      expires 31d;
      break;
    }
    # Matching URLs
    http://domain.com/stylesheets/blog.css?1221178271
    
    if ($request_uri ~* "\.(ico|gif|png|jpe?g|css|js|swf)(\?v\d\d?)?$") {
      access_log off;
      expires 31d;
      break;
    }
    # Matching URLs
    http://domain.com/stylesheets/blog.css
    http://domain.com/stylesheets/blog.css?v1
    http://domain.com/stylesheets/blog.css?v12
    bandwidthcachecachingexpiresimagesmedianginxperformances
    Embed | Raw source | 0
  • 6 years ago
    1. En HTML:
    2. <img src=“…” align=“absmiddle” /> Texte
    3. En CSS :
    4. <img src=“…” style=“vertical-align:middle” /> Texte
    absmiddlealigncsshtmlimagesimgtextesvertical
    Embed | Raw source | 0
  • 8 years ago
    1. <?php
    2. require_once “HTML/QuickForm.php” ;
    3. function process()
    4. {
    5.     global $file,$path;
    6.     if ($file->isUploadedFile()) {
    7.         $file->moveUploadedFile( $path);
    8.         print ‘Upload done!’;
    9.     }
    10.     else {
    11.         print “Keine Datei hochgeladen!”;
    12.     }
    13. }
    14. function ruleCheckImagesize()
    15. {
    16.     global $file;
    17.     if ($file->isUploadedFile()) {
    18.         $meta = $file-> getValue();
    19.         if($size = @getimagesize( $meta[‘tmp_name’])) {
    20.             if($size[0] ==  640 && $size[1 ] == 480) {
    21.                 return true;
    22.             }
    23.         }
    24.     }
    25.     return false;
    26. }
    27. $uploadForm = new HTML_QuickForm( ‘upload_form’, ‘post’);
    28. $uploadForm->registerRule( ‘imagesize’, ‘function’, ‘ruleCheckImagesize’ );
    29. $path = “d:/www/tmp/”;
    30. $file = $uploadForm-> addElement(‘file’, ‘filename’ , ‘File:’);
    31. $uploadForm->addRule( ‘filename’, ‘Du musst eine Datei wählen’‘uploadedfile’ );
    32. $uploadForm->addRule( ‘filename’, ‘Die Datei muss 640x480px gross sein!’‘imagesize’);
    33. $uploadForm->addElement( ‘submit’, ‘btnUpload’, ‘Upload’ );
    34. if ($uploadForm->validate()) {
    35.     $uploadForm->process( ‘process’, true);
    36. }
    37. else {
    38.     $uploadForm->display();
    39. }
    imagespearphpupload
    Embed | Raw source | 0

    images” related tags

    spirit’s tags