精华内容
下载资源
问答
  • 【DXP】File type not recognised

    千次阅读 2016-10-06 08:09:09
    【DXP】File type not recognised

    早上难得6点半起床画板子,结果在敷铜的时候死机了,不想等待,于是长按下了关机键

    开机后,迫不及待再次打开板子

    结果原理图和PCB都显示File type not recognised。。

    立马百度,原来DXP掉电就会导致这种情况,而且,是无法恢复的。。哭。。。


    但是HISTORY文件夹中还有备份,只不过是没有布线的


    网上比较靠谱的方法是设置软件自动备份时间。

    DXP图标->Preferences->Data Management->Backup页面,勾选Auto save every

    设置若干分钟自动备份一次


    教训,要吸收,尤其是这破电脑。。。


    展开全文
  • 训练模型导入.mat文件时出现...ValueError: Unknown mat file type, version 0, 0 ``` 读取文件代码为: ``` np.array(sio.loadmat(image[0][i])['section'], dtype=np.float32) ``` 望大神指教!不胜感激!
  • File Type and File Size Validation using VB.NET

    Table of Contents:
    AsyncFileUpload File Type and File Size Validation using VB.NET Server side validation: Validating File Types and File Sizes

    AsyncFileUpload File Type and File Size Validation using VB.NET

     
    (Page 1 of 2 )

    If you're just started using the AsyncFileUpload AJAX web control, you'll be pleased to hear it can do more than just upload files. There are also ways to validate the file types and sizes it uploads. This article will show you how, using both client and server side validation.

    You might have read the introductory tutorial on the AsyncFileUpload web control ("AsyncFileUpload Updatepanel Example in ASP.NET AJAX using VB.NET") as part of the AJAX Control Toolkit in ASP.NET 3.5. However, the sample project in that tutorial is plain and simple. It does not validate file types and file sizes, and it does not provide output as to the status of the file upload.

    In real web applications involving file uploading, there is a need to:

    • Validate the file type uploaded to the server.
    • Validate the uploaded file size.
    • Return results and status about the uploaded file. This tells the user whether the uploading is ongoing, completed or has encountered an error.

    AsyncFileUpload is an AJAX web control for uploading files without post back or with partial post back. This tutorial will introduce some validation techniques, mainly for the file types and sizes of the uploaded files.

    To do this effectively, the application should do both client and server side validation. The client side validation will use JavaScript and the server side validation will use VB.NET.

    Getting Started: Creating the Original AsyncFileUpload Project

    To get started, you will use the original project files, which will be implemented in this tutorial with validation. You can download it here:http://www.dotnetdevelopment.net/tutorials/asyncfileupload_projectoriginal.zip

    After downloading, right click on it and click “Extract here.” Copy the asyncfileupload_projectoriginal folder to your ASP.NET local website folders.

    Navigate into the folder and open Default.aspx.vb with Visual Web Developer. Edit the file upload path to reflect your own path. You need to revise this line and assign your own file upload path:

    Dim fileuploadpath1 As String = "E:aspdotnetprojectsasyncfileupload_projectoriginalupload"

    Launch your Visual Web Developer project. Under “Recent Projects” click “Open,” and under “Open Web Site” look for “asyncfileupload_projectoriginal,” and then click “Open.”

    Once you see the Default.aspx script, view the project using a web browser (File -> View in Browser). Try uploading a file larger than 4 MB -- an MP3 file, for example. You might notice that you will receive an error: “Unhandled Exception: Access is Denied.” This is because the default maximum allowable file size for uploading is 4 MB. To increase this limit to 20 MB (for example), you need to add this line in web.config:

    <location path="default.aspx">
    <system.web>
    <httpRuntime executionTimeout="110" maxRequestLength="20000" />
    </system.web>
    </location>

    You need to add those lines just above <system.web>. See screen shot:

    After making these changes, go to File -> Save all.  Go to Default.aspx and view the project again in the browser. Try uploading large files (greater than 4 MB but less than 20 MB); they will be successfully uploaded to the /upload/ folder in your project.

    Adding Throbber to Display Uploading Progress

    Before you can validate file types/sizes, it would be a good practice to add an uploading progress indicator by using a throbber. To do this,

    1. Add a ThrobberID="throbber" property in AsyncFileUupload:

    <asp:AsyncFileUpload ID="AsyncFileUpload1" runat="server" OnUploadedComplete ="UploadFile1" ThrobberID="throbber" /><br />

    2. Add an ASP.NET label control outputting the throbber to the browser:

    <asp:Label runat="server" ID="throbber" Style="display: none;">
    <img alt="" src="throbber/progress.gif" />
    </asp:Label>

    You can download the sample throbber folder with progress.gif indicator here:http://www.dotnetdevelopment.net/tutorials/throbber.zip

    Unzip it (Right click-> Extract here) and copy the throbber folder to the asyncfileupload_projectoriginal project folder.

    3. Test the throbber by viewing the project again in the browser. Try uploading large files greater than 10 MB but less than 20 MB; you will see the progress indicator working.

    Client side validation: Validating File Types and File Sizes

    The first step is to validate the file type and file sizes. The steps are as follows:

    1. Add ASP.NET labels to display upload status, upload file name, upload file size and content type. Add the following code next to throbber:

    <br />   
    <div style="display: none; font-family:Courier; width: 600px" id="dvFileInfo">
    Upload Status: <asp:Label ID="uploadsuccess" ForeColor="Blue" runat="server" /><br />
    Uploaded FileName: <asp:Label ID="uploadfiledisplay" ForeColor="Blue" runat="server" /><br />
    Uploaded File Size : <asp:Label ID="uploadfilesizedisplay" ForeColor="Blue" runat="server" /><br />
    Uploaded Content Type :<asp:Label ID="uploadcontenttypedisplay" ForeColor="Blue" runat="server" /><br />
    </div>

    2. Add ASP.NET labels to display upload related errors, such as wrong file type or inappropriate file sizes. Add the following code next to the code above and before </ContentTemplate>.

    <div style="display: none; font-family:Courier; width: 800px" id="dvFileErrorInfo">
    Upload Status: <asp:Label ID="uploaderror" ForeColor="Red" runat="server" /><br />
    </div>

    3. Add an OnClientUploadComplete="uploadComplete" in the AsyncFileUpload control. This is the JavaScript function that will execute after the user completely selects the file for uploading.

    <asp:AsyncFileUpload ID="AsyncFileUpload1" runat="server" OnUploadedComplete ="UploadFile1" OnClientUploadComplete="uploadComplete" ThrobberID="throbber" /><br />

    4. The next step is to add and create the uploadComplete JavaScript function to do the client validation for file types and file sizes. Add the following code between <head>…</head> section and just below <title></title>

    <script type="text/javascript">              
    function uploadComplete(sender, args) {
    try {
    var fileExtension = args.get_fileName();
    var mp3 = fileExtension.indexOf('.mp3');
    var filesizeuploaded = parseInt(args.get_length());
    if (mp3 > 0 && (filesizeuploaded < 5000000)) {
    $get("dvFileInfo").style.display = 'block';
    $get("dvFileErrorInfo").style.display = 'none';
    $get("<%=uploadsuccess.ClientID%>").innerHTML = "File Uploaded Successfully";
    $get("<%=uploadfiledisplay.ClientID%>").innerHTML = args.get_fileName();
    $get("<%=uploadfilesizedisplay.ClientID%>").innerHTML = args.get_length();
    $get("<%=uploadcontenttypedisplay.ClientID%>").innerHTML = args.get_contentType();
    }
    else {
    $get("dvFileErrorInfo").style.display = 'block';
    $get("<%=uploaderror.ClientID%>").innerHTML = "File NOT uploaded.Allowed file extension are mp3 file type only and should be less than 4.5 MB.";
    $get("dvFileInfo").style.display = 'none';
    return;
    }
    }
    catch (e) {
    alert(e.message);
    }
    }      

    </script>

    Code Discussion

    The user will browse the file to be uploaded to the server. After the user has completed this step, asyncfileupload automatically uploads the file and triggers the JavaScript function “uploadComplete” as defined in OnClientUploadComplete="uploadComplete."

    The first thing the function does is get the file name and assign it to the fileExtension JavaScript variable. Then the string “.mp3” will be searched for in the file name, using the JavaScript indexOf function, and the results will be assigned to the mp3 variable.

    Also, the file size of the uploaded file is computed using parseInt(args.get_length()); function in JavaScript.

    The most important part of the JavaScript function above is the condition:

    if (mp3 > 0 && (filesizeuploaded < 5000000)) {

    This condition will check to see if the file extension is mp3 and the file size uploaded is less than 5 MB. If this condition is true, it will return the following success values back to the client browser (courtesy of the ASP.NET labels declared previously):

    • Upload Status (which is a success)
    • Uploaded file name
    • Uploaded file size
    • Uploaded file type

    However, if the condition is false, it will return an error to the user stating that the file type and file sizes are not correct.

     

    AsyncFileUpload File Type and File Size Validation using VB.NET - Server side validation: Validating File Types and File Sizes

     
    (Page 2 of 2 )

     

    This is the most important part, because this will do the actual job of blocking the files to be uploaded/saved to the upload folder. If there is no server validation, any user can bypass client side validation and still upload files to your upload path.

    Below is the complete VB.NET script, which you will copy and paste into Default.aspx.vb:

    Imports System.Data
    Imports System.Configuration
    Imports System.Web
    Imports System.Web.Security
    Imports System.Web.UI
    Imports System.Web.UI.WebControls
    Imports System.Web.UI.WebControls.WebParts
    Imports System.Web.UI.HtmlControls
    Imports System.IO

    Partial Class _Default
        Inherits System.Web.UI.Page
        Protected Sub UploadFile1(ByVal sender As Object, ByVal e As System.EventArgs)
            Dim fileuploadreceive1 As String = AsyncFileUpload1.PostedFile.FileName
            Dim uploadedfilesize As Integer = AsyncFileUpload1.PostedFile.ContentLength
            Dim filename1 As String = Path.GetFileName(fileuploadreceive1)
            If ((Path.GetExtension(fileuploadreceive1).Contains(".mp3")) And (uploadedfilesize < 5000000)) Then
                Dim fileuploadpath1 As String = "E:aspdotnetprojectsasyncfileupload_projectoriginalupload"
                AsyncFileUpload1.PostedFile.SaveAs(Path.Combine(fileuploadpath1, filename1))
            End If
        End Sub
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            Label1.Text = DateTime.Now
        End Sub
    End Class

    Code Discussion

    The first thing the script will do is import the namespaces required for all of the functions. An example of namespaces includes the System.Data, System.Configuration, etc. Next it will execute the VB.NET function named UploadFile1. This is the function that will execute as defined in the AsyncFileUpload OnUploadedComplete ="UploadFile1" property.

    The following declaration statements will get the posted file to the server, and also get the filename and the file size.

    Dim fileuploadreceive1 As String = AsyncFileUpload1.PostedFile.FileName
    Dim uploadedfilesize As Integer = AsyncFileUpload1.PostedFile.ContentLength
    Dim filename1 As String = Path.GetFileName(fileuploadreceive1)

    As with the client side validation, the most important part of the VB.NET script is the condition:

    If ((Path.GetExtension(fileuploadreceive1).Contains(".mp3")) And (uploadedfilesize < 5000000))

    This returns true if the file posted is an mp3 file (contains an mp3 file extension) and the file size is less than 5 MB. If this is true, the posted file will be saved to the defined path in your ASP.NET server:

    Dim fileuploadpath1 As String = "E:aspdotnetprojectsasyncfileupload_projectupload"
                AsyncFileUpload1.PostedFile.SaveAs(Path.Combine(fileuploadpath1, filename1))

    Go to File -> Save All, and then go to Default.aspx to view the completed project in the browser. Try uploading an MP3 file which is less than 5 MB and you will see a result similar to the one shown below:

    <

    The file will be successfully uploaded and saved to the upload path defined in the scripts. Also try uploading a file which is larger than than the 5 MB upload file size limit. You will see an error such as the one shown below:

    The file will not be uploaded and saved to the upload path in your server.

    You can download the revised/completed project here:http://www.dotnetdevelopment.net/tutorials/asyncfileupload_projectoriginal_revised.zip

    Some portion of the code discussed in this tutorial are improvised based on the scripts provided here:

    http://weblogs.asp.net/manojkdotnet/archive/2009/10/16/asynfileupload-control-and-its-validation.aspx

    http://yasserzaid.wordpress.com/2009/11/30/ajax-asynfile-upload-with-file-extension-validation/  

    展开全文
  • 小程序文件下载时候报错saveVideoToPhotosAlbum:fail invalid file type 因为类型不正确需要指定一下下载的类型。 wx.downloadFile({ url: s, header: i.buildHeader(n), success: function(i) { 200 === i.status...

    小程序文件下载时候报错saveVideoToPhotosAlbum:fail invalid file type 因为类型不正确需要指定一下下载的类型。 wx.downloadFile({
    url: s,
    header: i.buildHeader(n),
    success: function(i) {
    200 === i.statusCode ? (t.setData({
    downloadVideoBtnText: “保存中”
    }), t.setData({
    tempVideoFilePath: i.tempFilePath
    }), console.log(i), wx.saveVideoToPhotosAlbum({
    filePath: i.tempFilePath,
    success: function(e) {
    if (console.log(e), t.setData({
    showDownloadProgressModel: !1
    }), -1 != t.data.adBannerType && 1 == t.data.showAlertAD) t.setData({

                            downloadVideoDisabled: !1,
                            showModal: !0
                        }); else {
                            var a = "成功保存到手机,保存位置请看屏幕提示";
                            "ios" == o.globalData.systemInfo.platform && (a = "成功保存到手机相册"), wx.showModal({
                                showCancel: !1,
                                title: "保存成功",
                                content: a
                            });
                        }
                        console.log(e.errMsg);
                    },
                    fail: function(e) {
                        console.log(e), wx.showToast({
                            title: "保存失败,请允许保存至相册"
                        }), t.setData({
                            showDownloadProgressModel: !1,
                           
                            downloadVideoDisabled: !1
                        });
                    }
                })) : (wx.reportAnalytics("download_fail", {
                    link: s,
                    source_link: t.data.parseVideoUrl
                }), 1 == a ? (console.log("重试"), t.setData({
                    downloadVideoBtnText: "正在重试...",
                    downloadVideoDisabled: !0
                }), t.downloadVideo(e, a + 1)) : (t.setData({
                    showDownloadProgressModel: !1
                }), wx.showModal({
                    title: "下载失败",
                    content: t.data.downloadErrorMsg
                })));
            },
            fail: function(o) {
                o.errMsg, 1 == a ? (console.log("重试"), t.setData({
                    downloadVideoBtnText: "正在重试...",
                    downloadVideoDisabled: !0
                }), t.downloadVideo(e, a + 1)) : (t.setData({
                    showDownloadProgressModel: !1
                }), wx.showModal({
                    title: "下载失败",
                    content: t.data.downloadErrorMsg
                }));
            },
    
    展开全文
  • 背景介绍 开发环境:IntelliJ IDEA COMMUNITY 2019.2 创建名称为 HelloWorld 的 Java 文件时出现以下错误: ...Error message: Selected Class file name 'HelloWorld.Java'mapped to not java file type...

    背景介绍

    开发环境:IntelliJ IDEA COMMUNITY 2019.2

    创建名称为 HelloWorld 的 Java 文件时出现以下错误:

    Unable to parse template "Class"
    
    Error message: Selected Class file name 'HelloWorld.Java' mapped to not java file type 'Text'.

     

    解决方案

    出现这个问题时因为包含的资源包“sun.jvm.hotspot.HelloWorld;”已经有HelloWorld的类,所以IntelliJ IDEA COMMUNITY 2019.2自动判定为非法Java文件而转成Text文件进行创建。建议将 HelloWorld的第一个字母改成小写 helloWorld

     

     

     

     

    展开全文
  • pycharm修改file type

    千次阅读 2017-12-13 19:18:47
    原因添加一个文件 config.ini, 理论上说该文件会以....ini正确打开方式.Text正确打开方式手贱操作后的样子解决File - Setting - Editor - File Types搜索Text,然后选中,找到config_alpha.ini然后删掉,搞定!!!!
  • 引用css时var footerCss = require("../../css/...运行报错You may need an appropriate loader to handle this file type. webpack.config.js配置如下 var debug = process.env.NODE_ENV !== "production"; var
  • 使用环境(蓝色粗体字为特别注意内容) 1、软件环境:Win7 32 bit,AD(Altium Designer) 10.39. ...提示"File type not recognised", 经多方查找资料,发现有一个补救的办法,打开工程目录,找到History文...
  • 解决方式:配置有问题,将UserServiceImpl.java删除掉。【其它类似创建错误的方式也一样,在Recognized File Type中找到相应的错误类型,然后将Registered Patterns中的错误类型删除。】...
  • 解决微信返回码为40113,...unsupported file type&quot; // PHP代码 $file_name = md5(microtime()*1000000); $file_type = 'image'; $post_data = array( 'media'=&amp;gt;new CurlFile(realpath($ur...
  • 报错是这样的: ERROR in ./src/index.js 8:13 Module parse failed: Unexpected ...You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file....
  • file type not recognised ---DXP 09

    万次阅读 2013-09-06 07:38:24
    一大早起来准备画图,打开DXP ,出现了“file type not recognised” ,奇怪啊,怎么出现这个,接着打开昨天画了一半的PCB和原理图,发现变成一片空白了。。。吐血啊。想着完了,完了,得重新搞了,,,昨晚明明保存...
  • 在 YOLO v3模型中运用 cocoapi 进行评估模型,安装时报错显示:error: unknown file type '.pyx' (from 'pycocotools/_mask.pyx'),可能原因是运行的python版本问题,运行命令 make 时默认调用的是系统的python2,...
  • 在安装 tsne时报错 error: unknown file type '.pyx' (from 'tsne/bh_sne.pyx') ------------------------------------------------------------ 解决办法: 安装:pip install pyrex 如果
  • webpack 引入css编译问题 // 配置loader,在webpack.config.js中 module:{ rules:[ { test:/\.css$/i, //使用style-loader css-loader 从右往左生效 use:['style-loader','css-l...
  • 报错具体内容 报错原因:webpack 原生只支持 js 文件类型,及 es5 的语法 解决办法:配置解析规则,在 webpack.config.js 文件中配置 module: { rules: [ { test: /.vue$/, loader: 'vue-loader' ...
  • 解决方法: 在downloadFile中设置filePath,而不要使用默认的,然后 saveImageToPhotosAlbum使用filePath 即可完美解决!不需要设置content-type等信息。
  • 我在使用require("./style.css");的时候,也就是想要把css文件也一并打包,但是webpack本身是不支持的,所以我们需要安装npm install css-loader style-loader --save-dev安装成功接下来指定loader把 require...
  • fckeditor 中提示invalid file type 问题

    千次阅读 2013-05-08 16:06:46
    修改两个地方即可解决: 1、fckeditor/fckconfig.js文件 找到: ...FCKConfig.LinkUploadURL = FCKConfig.BasePath + 'filemanager/connectors/' + _QuickUploadLanguage + '/upload.' + _Quick
  • 具体到笔者的情况是:在将 MultipartFile 类型转换为File 类型时,方法 File.createTempFile("filename","suffix") 中 第二个参数为后缀名, 没有加"." 如.jpg,而是写成了jpg,导致生成的文件没有后缀名. 转载于:...
  • You may need an appropriate loader to handle this file type. (Source code omitted for this binary file) @ ./jd-shopcarts/assets/basic.css (./node_modules/css-loader!./jd-shopcarts/assets/basic.css) 7...
  • ExFAT support on CentOS7 yum install -y http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm yum install exfat-utils fuse-exfat
  • fckeditor]中提示invalid file type 问题

    千次阅读 2011-02-14 11:07:00
    修改两个地方即可解决: 1、fckeditor/fckconfig.js文件 找到: FCKConfig.LinkUpload = true ; FCKConfig.LinkUploadURL = FCKConfig.BasePath + 'filemanager/...Type=File'; FCK
  • 这里记录一下本人遇见这个错误的原因及处理办法: vue-loader版本过高,与其他工具不兼容(通过查看脚手架里引用的版本做对应修改) 1.先卸载安装的版本(环境各异) npm uninstall vue-loader ...
  • sudo apt-get install libsox-fmt-mp3
  • 学习webpack+vue时,出现了这个错误。 百度一下这个问题是因为webpack.config.js中没有配置vue-loader。所以在webpack.config.js文件加上 const path = require('path') module.exports = { ...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 214,877
精华内容 85,950
关键字:

filetype