简体   繁体   English

使用URL上传文件是否应允许FTP url?

[英]File Upload using URL should allow FTP urls or not?

In my project we are uploading files to server, and allowing URLs also. 在我的项目中,我们将文件上传到服务器,并且还允许使用URL。 Before using those URLs we validate URL using following validation function: 在使用这些URL之前,我们使用以下验证功能来验证URL:

public function checkUrl( $strUrl ) {
    return ( true == preg_match( '/^(http|https|ftp):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?/i', $strUrl ) ) ? true : false;
}

now in this we have allowed ftp also. 现在在此我们也允许ftp。

I just want to know, is it a good idea to allow FTP URLs in file upload? 我只想知道,在文件上传中允许FTP URL是个好主意吗?

Personally I avoid this (w. no particular reason). 我个人避免这种情况(没有特殊原因)。 But why not ;) 但是为什么不;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM