Jump to content
php.lv forumi

Elementārs uploads


ziedinjsh

Recommended Posts

audio/mp3 nomainīju uz audio/mpeg

if($type == "audio/mp3" || $size >167772160) {
 die("this format is not allowed or file is to big");
 }

$type == "audio/mp3" - t.i ja fails ir mp3 audio, tad die vai fails > 167772160, tad die )

audio/mp3 manuprat bija pareizs!?

P.S ja augsuplade mp3 failu bez faila tipa .mp3 beigas caur type radis, ka tas audio fails?)

Edited by kapec gan ne
Link to comment
Share on other sites

Ir pagaidām tā... ja ir mp3 fails un / vai tas atbilst noteiktajam lielumam (citiem vārdiem sakot, ja viss ir kārtībā), tad beidzam skriptu un izmetam kļūdas paziņojumu!

 

RTFM!

Link to comment
Share on other sites

Ir pagaidām tā... ja ir mp3 fails un / vai tas atbilst noteiktajam lielumam (citiem vārdiem sakot, ja viss ir kārtībā), tad beidzam skriptu un izmetam kļūdas paziņojumu!

 

RTFM!

Neatbilst.

 

 

if($type == "audio/mp3" || $size >167772160) {
 die("this format is not allowed or file is to big");
}

 

Tulkotos kā

 

JA(tips ir autdio/mp3 VAI faila izmŗes ir lielāks par 167772160 baitiem) TAD beidzam skripta izpildi un izmetam paziņojumju "this format is not allowed or file is to big"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...