我必須解決這個問題是使用asp.net網站上的錯誤,我不知道這種事,(asp.net C#,MVC) ...其中來自「構建」文件夾中的代碼在asp.net C#(MVC)
問題是在一個名爲uploadify插件,並呼籲腳本上傳文件:
'script': '<%= ResolveUrl("~/Build/UploadImages")%>/<%= ViewData["build_id"] %>',
在瀏覽器中顯示是這樣的:
'script': '/prod/cms/Build/UploadImages/680ad442-8e9c-459c-b253-e9c389c1622b',
問題文件夾「Build」不存在,我認爲它是由...創建的asp.net ....
我無法找到上傳文件的代碼...我在所有文件中隨處搜索「SaveAs」,「SaveFileAs」,「Upload」,「Uploadify」並且我還沒有找到它......
是uploadify給人的問題是「HTTP錯誤」後,顯示上傳的100%,我搜索的谷歌,但沒有運氣......我想如果我找到了腳本上傳文件,也許我可以修復它
這裏是我的文件的所有腳本:
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Framework.Models.Image>>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
Photo
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h2>
Photo</h2>
<p>
<label>
Tipo:</label>
<%= Html.DropDownList("type", (SelectList)ViewData["types"], new { onchange = "changeScript(this.value)" })%>
</p>
<div id="dvUpload">
<input id="upload" name="upload" type="file" />
<a href="#" onclick="Upload('<%= ViewData["build_id"] %>')">Fazer Upload</a> | <a
href="javascript:$('#upload').uploadifyClearQueue();">Limpar Uploads</a>
</div>
<%-- <% using (Html.BeginForm("UploadImages", "build", new { id = ViewData["build_id"], type = "c1956908-64f5-4195-ba73-4d7710d560d7" }, FormMethod.Post, new { enctype = "multipart/form-data" }))
{%>
<input id="File1" name="upload" type="file" />
<input type="submit" value="Enviar" />
<%} %>--%>
<br />
<br />
<table>
<tr>
<th>
</th>
<th>
Type
</th>
<th>
Imagem
</th>
<th>
Legenda
</th>
</tr>
<% foreach (var item in Model)
{ %>
<tr>
<td>
<%= Html.ActionLink("Apagar", "deleteimage", new { id = item.Properties.id, build_id = item.Properties.build_id }, new { onclick = "return confirm('Confirma esta ação?')" })%>
</td>
<td>
<%= Html.Encode(item.Type)%>
</td>
<td>
<img src="<%= Cms.Helpers.Settings.CMS_ADDRESS + item.Properties.url_address %>" width="150" height="100" />
</td>
<td>
<%= Html.TextBox(item.Properties.id.ToString(), item.Properties.description) %>
<input type="button" value="Ok" onclick="saveLegend('<%= item.Properties.id.ToString() %>')" />
</td>
</tr>
<% } %>
</table>
<p>
<%= Html.ActionLink("Create New", "Create") %>
</p>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeaderContent" runat="server">
<script type="text/javascript" src="<%= ResolveUrl("~/Content/JS/swfobject.js") %>"></script>
<script type="text/javascript" src="<%= ResolveUrl("~/Content/JS/jQuery/jquery.uploadify.v2.1.0.js") %>"></script>
<script type="text/javascript">
var html = "";
jQuery(document).ready(function() {
html = jQuery("#dvUpload").html();
jQuery("#upload").uploadify({
'uploader': '<%= ResolveUrl("~/Content/Flash/uploadfy.swf") %>',
'script': '<%= ResolveUrl("~/Build/UploadImages")%>/<%= ViewData["build_id"] %>',
'cancelImg': '<%= ResolveUrl("~/Content/Images/cancel.png") %>',
'folder': '<%= ResolveUrl("~/Content/Images") %>',
'multi': true,
'simUploadLimit': 10,
'fileDesc': 'Apenas Imagens são permitidas',
'fileExt': '*.gif;*.jpg;*.png',
'onError' : function(errorType) {
//alert('The error was ' + errorType.toSource());
alert(JSON.stringify(errorType, null, 4));
},
'onComplete': function() {
alert("foi tudo");
}
});
AddNullValueSelectObject('type');
});
function Upload(build_id) {
jQuery('#upload').uploadifyUpload();
}
function changeScript(val)
{
jQuery("#dvUpload").empty();
jQuery("#dvUpload").html(html);
var culture = jQuery('#culture').val();
jQuery("#upload").uploadify({
'uploader': '<%= ResolveUrl("~/Content/Flash/uploadfy.swf") %>',
'script': '<%= ResolveUrl("~/Build/UploadImages")%>/<%= ViewData["build_id"] %>?type=' + val,
'cancelImg': '<%= ResolveUrl("~/Content/Images/cancel.png") %>',
'folder': '<%= ResolveUrl("~/Content/Images") %>',
'multi': true,
'simUploadLimit': 10,
'fileDesc': 'Apenas Imagens são permitidas',
'fileExt': '*.gif;*.jpg;*.png',
'onError' : function(errorType) {
//alert('The error was: ' + errorType.toSource());
alert(JSON.stringify(errorType, null, 4));
},
'onComplete': function() {
alert("foi tudo");
}
});
}
function saveLegend(id)
{
var text = jQuery('#' + id).val();
jQuery.ajax({
type: 'GET',
url: '<%= ResolveUrl("~/build/UpdatePhotoLegend")%>/' + id,
data: 'legend=' + text,
success: function(data) {
alert('Alterado com sucesso!');
}
});
}
function AddNullValueSelectObject(object_id) {
jQuery('#' + object_id).append("<option value='00000000-0000-0000-0000-000000000000'>--- SELECIONE ---</option>");
jQuery("#" + object_id + " option[value='00000000-0000-0000-0000-000000000000']").attr('selected', 'selected');
}
</script>
</asp:Content>
比KS提前...
這有可能是腳本被嵌入的資源。嘗試使用ILSpy來確認這一點。在這種情況下,您需要訪問源代碼。另外,這可能是腳本被縮小/混淆了,這就是爲什麼你找不到任何東西。 –
謝謝,我發現它使用ILSpy和反編譯dll .. –