从客户端(content1="<img src="/web/news/...")中检测到有潜在危险的 Request.Form 值

本文介绍了在HTML编辑器中上传图片时遇到的客户端潜在危险Request.Form值的问题,并提供了两种解决方案:一是通过修改Web.Config文件禁用验证;二是直接在ASPX页面中禁用验证。对于.NET 4.0还需额外配置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在html编辑器里面加入图片提交的时候

就报一个 从客户端(content1="<img src="/web/news/...")中检测到有潜在危险的 Request.Form 值

有两种方法

方法一:

修改Web.Config文件:     
<configuration>     
      <system.web>     
          <pages   validateRequest="false"   />     
      </system.web>     
</configuration>

方法二:

在.aspx页面中添加:     
<%@   Page   validateRequest="false"   %>

.net 4.0 还需要在web.config里面加一句

<configuration>     
      <system.web>     
       <httpRuntime requestValidationMode="2.0" />
      </system.web>     
</configuration>

问题就解决了!

转载于:https://www.cnblogs.com/only-yu/p/6699320.html

有网页的源码,怎么在idea里用vue复现,运用element-UI组件,view-source:https://rloopbase.nju.edu.cn/ ,源码如下: <html xmlns="http://www.w3.org/1999/xhtml " xml:lang="en" lang="en"> <link rel="stylesheet" type="text/css" href="/css/myIndex.css"> <head> <title>R-loopBase</title> <link rel="icon" href="/images/icon-rloop-purple-circle-2.png" type="image/x-icon"> </head> <body> <div class="container"> <div class="indexBar"></div> <div class="card"> <!-- Introduction --> <div class="cardTitle"> Introduction </div> <div class="cardContext"> <p id="introductionText" class="cardP">The R-loop, a three-stranded nucleic acid structure composed of an RNA:DNA hybrid and a displaced single-stranded DNA, plays versatile roles in many physiological and pathological processes. However, its controversial genomic localization and incomplete understanding of its regulatory network raise great challenges for R-loop research. Here, we present R-loopBase to tackle these pressing issues by systematic integration of a huge amount of genomics and literature data. A reference set of human R-loop zones is computed with confidence scores and detailed annotations (<span style="font-weight: bold"><a href="/index.jsp">Search</a></span>, <span style="font-weight: bold"><a href="/help.jsp">Help</a></span> and <span style="font-weight: bold"><a href="/download.jsp">Download</a></span>), all of which can be visualized in well-annotated genomic context in a local genome browser (<span style="font-weight: bold"><a href="https://rloopbase.nju.edu.cn/browser/cgi-bin/hgTracks ">Browser</a></span>). A list of 1,185 R-loop regulators is manually curated from PubMed literatures and annotated with most up-to-date multi-omics data (<span style="font-weight: bold"><a href="/rloopRegulator.jsp">Regulator</a></span></span>). We have also manually curated 24 R-loop regulators in mouse, 63 in yeast (<i>saccharomyces cerevisiae</i>) and 21 in <i>Escherichia coli</i> to facilicate R-loop research in these model organisms (<span style="font-weight: bold"><a href="/rloopRegulator.jsp">Regulator</a></span>). We further deduce the functional relationship between individual R-loops and their putative regulators (<span style="font-weight: bold"><a href="/rloopRegulator.jsp">Regulator</a></span> and <span style="font-weight: bold"><a href="/download.jsp">Download</a></span>). In total, we have generated billions of entries of functional annotations, which can be easily accessed in our user-friendly interfaces (<span style="font-weight: bold"><a href="/help.jsp">Help</a></span>). The regulator summary and genomic annotation of R-loop regions will be constantly updated along the research progress of field. You are welcome to contribute to updating R-loop regulators and related literatures (Regulator Updating System on <span style="font-weight: bold"><a href="/rloopRegulator.jsp">Regulator</a></span> page). Any suggestions and feedbacks from you are also welcome (<span style="font-weight: bold"><a href="/contact.jsp">Contact</a></span>). </p> </div> <a href="##"><div id="showIntroduction" onclick="showMoreOrLess()" style="text-decoration: underline; text-align: right; padding-right: 20px; margin-top: -15px;">Show more</div></a> <hr class="cardHr"> </div> <!-- Introduction --> <div class="searchContainer"> <div class="searchLogo"> <ul> <li class="searchLogoText">R-loopBase</li> <li class="searchLogoImg"><img src="/images/icon-rloop-purple-circle-2.png" style="height: 60px;"></li> </ul> </div> <div class="searchForm"> <input id="searchText" type="text" name="" placeholder="e.g. BRCA2 or chr1:154572702-154628593" onkeypress="handle(event)"> <a href="#"><div class="searchItem" href="#" onclick="toGeneList()"> <i>search</i> </div></a> </div> </div> <div class="horizontalMenu"> <!-- horizontal menu --> <ul id="indexNavigator"> <li> <a href="/browser/cgi-bin/hgTracks"> <img src="/images/browser.png"> <div>Browser</div> </a> </li> <li> <a href="/rloopRegulator.jsp"> <img src="/images/regulator.png"> <div>Regulator</div> </a> </li> <li> <a href="https://rloopbase.nju.edu.cn/deepr/tool/model "> <img src="/images/tool.png"> <div>Tool</div> </a> </li> <li> <a href="/download.jsp"> <img src="/images/download.png"> <div>Download</div> </a> </li> <li> <a href="/help.jsp"> <img src="/images/help.png"> <div>Help</div> </a> </li> <li> <a href="/contact.jsp"> <img src="/images/contact.png"> <div>Contact</div> </a> </li> </ul> </div> <!-- horizontal menu --> <div class="twoCardContainer"> <div class="card cardLeft"><!-- News --> <div class="cardTitle"> News </div> <div class="cardContext" id="newsDiv" style="overflow:hidden;clear:both;height:220px"> <ul> <li>2023.10.01 Online of <a href='https://rloopbase.nju.edu.cn/deepr/tool/model '>DeepER</a>, an R-loop prediction tool.</li> <li>2022.02.19 A new <a href="https://doi.org/10.1101/2022.02.18.480986 ">preprint</a> by R-loopBase team.</li> <li>2021.11.18 Published on <a href="https://doi.org/10.1093/nar/gkab1103 ">Nucleic Acids Res</a>.</li> <li>2021.06.20 Official release of R-loopBase v1.0.</li> <li>2021.06.15 Internal evaluation before public release.</li> <li>2021.05.10 Build-up of R-loopBase genome browser.</li> <li>2021.03.31 Data freeze for R-loopBase v1.0.</li> <li>2021.01.18 Launching R-loopBase project.</li> <li>2020.10.10 Systematic evalation of all R-loop mapping technologies.</li> </ul> </div> <a href="##"><div id="showNews" onclick="showMoreOrLess2()" style="text-decoration: underline; text-align: right; padding-right: 20px; margin-top: 4px;">Show more</div></a> <hr class="cardHr"> </div><!-- News --> <div class="card cardRight"> <!-- Publication --> <div class="cardTitle"> Latest Publications </div> <div class="cardContext" id="publicationDiv"> <ul> <li><a style="color: black" href="https://pubmed.ncbi.nlm.nih.gov/38590928/ ">LUC7L3 is a downstream factor of SRSF1 and prevents genomic instability.</a> Cell Insight. 2024.</li> <li><a style="color: black" href="https://pubmed.ncbi.nlm.nih.gov/38677845/ ">Smartphone-based device for rapid and single-step detection of piRNA-651 using anti-DNA:RNA hybrid antibody and enzymatic signal amplification.</a> Anal Chim Acta. 2024.</li> <li><a style="color: black" href="https://pubmed.ncbi.nlm.nih.gov/38609257/ ">Split activator of CRISPR/Cas12a for direct and sensitive detection of microRNA.</a> Anal Chim Acta. 2024.</li> </ul> <div style="width: 100%; text-align: right; margin-top: -4px;"><a href="https://pubmed.ncbi.nlm.nih.gov/?term=%28R-loop%29+OR+%28R-loops%29+OR+%28%22RNA+DNA+hybrid%22%29+OR+%28%22RNA+DNA+hybrids%22%29+OR+%28%22DNA+RNA+hybrid%22%29+OR+%28%22DNA+RNA+hybrids%22%29&sort=pubdate ">More publications in PubMed</a></div> </div> <hr class="cardHr"> </div> <!-- Publication --> </div> <div class="footer"> <div style="background-color: rgb(90,19,92); height: 60px; line-height: 60px; text-align: center; color: white; "> <div style="display: inline-block; height: 20px; line-height: 20px; margin-top: 15px; margin-bottom: 4px;">© 2020-2025 NANJING UNIVERSITY. ALL RIGHTS RESERVED. </div> <div style="height: 20px; line-height: 20px; margin-top: 0px;">CONDITIONS OF USE</div> </div> </div> </div> <!-- container --> </body> </html> <script type="text/javascript" language="JavaScript"> function handle(e){ if(e.keyCode === 13){ e.preventDefault(); // Ensure it is only this code that runs toGeneList(); } } function toGeneList(){ //var type = document.getElementById('searchSelect').value; var type; var value = document.getElementById('searchText').value; if(value==''){ alert("Please input keyword!"); }else if(value.match(/[^a-zA-Z0-9:-]/)){ alert("Only numbers, letters, \":\" and \"-\" are allowed!"); }else{ //top.location = '/geneList.jsp?searchFor=' + type + '&keyword=' + value; if(value.match(/^chr.+:\d+-\d+$/)){ type="location"; }else{ type="symbols"; } top.location = '/rloopList.jsp?searchFor=' + type + '&keyword=' + value; } } function changeLiSize(){ var selectId = document.getElementById("myNavigator"); } function showMoreOrLess(){ var selectId = document.getElementById("showIntroduction"); var selectText = document.getElementById("introductionText"); if(selectId.innerText == "Show more"){ selectText.style.height="auto"; selectId.innerText="Show less"; }else{ selectText.style.height="120px"; selectId.innerText="Show more"; } } function showMoreOrLess2(){ var selectId2 = document.getElementById("showNews"); var selectText2 = document.getElementById("newsDiv"); if(selectId2.innerText == "Show more"){ selectText2.style.height="auto"; selectId2.innerText="Show less"; }else{ selectText2.style.height="220px"; selectId2.innerText="Show more"; } } var publicationDivHeight = document.getElementById('publicationDiv').clientHeight; </script>
最新发布
07-29
<template> <div class="news-images"> <div v-for="(img, idx) in images" :key="idx" class="news-img-wrap"> <!-- 上传进度显示 --> <div v-if="img.status === 'uploading'" class="progress-overlay"> <van-circle v-model:current-rate="img.progress" :rate="100" :speed="10" size="120rem" :stroke-width="20" stroke-linecap="round" class="progress" > <span class="progress-text">{{ img.progress }}%</span> </van-circle> </div> <!-- 错误状态显示 --> <div v-if="img.status === 'error'" class="error-overlay"> <van-icon name="warning" size="32rem" color="#ff4444" /> <span>上传失败</span> <van-button type="primary" size="small" @click="reUpload(idx)" style="margin-top: 16rem">重新上传</van-button> </div> <img :src="img.url" class="news-img" /> <div class="img-close" @click="removeImg(idx)"> <van-icon name="cross" size="32rem" color="#fff" /> </div> </div> <div v-if="images.length < maxCount" class="news-img-add" @click="onAddImg"> <van-icon name="plus" size="64rem" color="#bbb" /> </div> <!-- 隐藏的文件选择器 --> <input ref="fileInput" type="file" multiple accept="image/*" style="display: none" @change="handleFileChange" /> </div> </template> <script setup lang="ts"> import { apis } from '@/api' import System from '@/utils/System' import { showToast } from 'vant' import { ref, onUnmounted } from 'vue' const emit = defineEmits(['update:modelValue']) const props = defineProps({ autoUpload: { type: Boolean, default: true }, maxCount: { type: Number, default: 9 }, modelValue: { type: Array as () => imgageItem[], default: () => [] } }) interface imgageItem { url: string progress: number status: 'pending' | 'uploading' | 'success' | 'error' file?: File } const fileInput = ref<HTMLInputElement | null>(null) const images = ref<imgageItem[]>(props.modelValue) const onAddImg = () => { fileInput.value?.click() } const removeImg = async (idx: number) => { images.value.splice(idx, 1) emit('update:modelValue', [...images.value]) } // const handleFileChange = async (e: Event) => { // const target = e.target as HTMLInputElement // const files = target.files // if (!files || files.length === 0) return // for (const file of Array.from(files)) { // if (images.value.length >= props.maxCount) break // try { // const reader = new FileReader() // console.log("🚀 ~ handleFileChange ~ reader:", reader) // reader.onload = (ev) => { // if (typeof ev.target?.result === 'string') { // const index = images.value.length // images.value.push({ // url: ev.target.result, // 临时预览URL // progress: 0, // status: 'pending', // file: file // }) // console.log("🚀 ~ handleFileChange ~ images.value:", images.value) // if (props.autoUpload) { // uploadFile(file, index) // } // reader.readAsDataURL(file) // } // } // // 清空 input // ;(e.target as HTMLInputElement).value = '' // // 更新父组件 // emit('update:modelValue', [...images.value]) // } catch (error) { // System.toast('图片处理失败') // console.error('文件处理错误:', error) // } // } // // 清空文件选择器 // ;(e.target as HTMLInputElement).value = '' // } const handleFileChange = (e: Event) => { const files = (e.target as HTMLInputElement).files if (files && files.length > 0) { Array.from(files).forEach((file) => { if (images.value.length >= 6) return const reader = new FileReader() reader.onload = (ev) => { if (typeof ev.target?.result === 'string') { const index = images.value.length images.value.push({ url: ev.target.result, // 临时预览URL progress: 0, status: 'pending', file: file }) // 开始上传 if (props.autoUpload) { uploadFile(file, index) } } } reader.readAsDataURL(file) }) emit('update:modelValue', [...images.value]) // 清空 input ;(e.target as HTMLInputElement).value = '' } } const uploadFile = async (file: File, index: number) => { // try { images.value[index].status = 'uploading' // 调用API上传 const formData = new FormData() formData.append("file",file) const res: any = await apis.uploadFile({ file: formData.get('file') }, (progressEvent: { loaded: number; total: number }) => { if (progressEvent.total > 0) { images.value[index].progress = Math.round((progressEvent.loaded / progressEvent.total) * 100) } }) if (res.code === 200) { images.value[index].status = 'success' images.value[index].url = res.data } else { images.value[index].status = 'error' System.toast('图片上传失败') } emit('update:modelValue', [...images.value]) // } catch (error) { // images.value[index].status = 'error' // System.toast('图片上传失败') // console.error('上传错误:', error) // emit('update:modelValue', [...images.value]) // } } // 自动上传全部待上传图片 const autoUploadAll = () => { images.value.forEach((img, index) => { if (img.status === 'pending' && img.file) { uploadFile(img.file, index) } }) } // 重新上传指定失败图片 const reUpload = (index: number) => { if (images.value[index].status !== 'error' || !images.value[index].file) return images.value[index].status = 'pending' uploadFile(images.value[index].file!, index) } // 组件卸载时清理临时文件 onUnmounted(async () => {}) defineExpose({ autoUploadAll, reUpload }) </script> <style lang="less" scoped> .news-images { display: flex; flex-wrap: wrap; gap: 18.5rem; margin-bottom: 48rem; .news-img-wrap { position: relative; width: 216rem; height: 216rem; border-radius: 23rem; overflow: hidden; margin-bottom: 32rem; // 新增,保证多行间距 .progress-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); display: flex; justify-content: center; align-items: center; z-index: 2; .progress { display: flex; align-items: center; justify-content: center; } .progress-text { color: #fff; font-size: 24rem; } } .error-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 2; span { color: #fff; font-size: 24rem; margin-top: 8rem; } } .news-img { width: 100%; height: 100%; object-fit: cover; border-radius: 24rem; } .img-close { position: absolute; top: 8rem; right: 8rem; background: rgba(0, 0, 0, 0.4); border-radius: 50%; width: 40rem; height: 40rem; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 3; } } .news-img-add { width: 216rem; height: 216rem; background: #f6f6f6; border-radius: 23rem; display: flex; align-items: center; justify-content: center; cursor: pointer; margin-bottom: 32rem; // 保持添加按钮与图片对齐 .van-icon { font-weight: bold; } } } </style> 我这样子使用的,在浏览器上传是正常的,但是在安卓模拟器上无法上传,其他接口都可以正常请求,但是文件上传时content-type会没有,但是我是设置了的
07-05
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值