zend framework帶有部分條件的檔案上傳

2021-05-27 20:49:41 字數 957 閱讀 4451

檔案上傳在重新命名的時候做的不好!

indexcontroller如下:

public function uploadaction ()}}

//返回上傳後出現的資訊

if (! $adapter->receive())

echo $messages = "檔案上傳失敗!請.

$this->view->baseurl() . "/index/index'>返回";

} else

}//獲取副檔名

public function getextension ($name)

$exts = @split("[/\\.]", $fname);

$n = count($exts) - 1;

$exts = $exts[$n];

return $exts;}}

檢視如下:

<

form

action

="<?php

echo

$this->baseurl();

?>/index/upload/"

method

="post"

enctype

="multipart/form-data">

<

input

type

="hidden"

name

="max_file_size"/>

請選擇您的上傳檔案:

<

input

name

="uploadedfile"

type

="file"

/><

br/>

<

input

type

="submit"

value

="檔案上傳"

/><

br>

form>

zend framework學習小結

zend framework是mvc模式的一種實現,要快速的入門差不多只看zend controller zend view 部分就可以了吧。1.zend controller部分。最重要的類是zend controller front.使用它的經典 這部分是包含在index。php中的。在正確的配...

zend framework學習小結

zend framework是mvc模式的一種實現,要快速的入門差不多只看zend controller zend view 部分就可以了吧。1.zend controller部分。最重要的類是zend controller front.使用它的經典 很 簡單 這部分是包含在index。php中的。...

zend framework常用元件

zend acl 許可權控制 zend auth 主要用於認證 zend cache 為應用程式提供快取支援 zend config 應用程式的配置資料引數 zend db 提供zend framework 與mysql的資料庫操作方式 zend layout 實現應用程式的試圖布局 zend ma...