
后台获取该路径。
c#举列如下:
获取路径:
string uploadPath = HttpContext.Current.Server.MapPath(@context.Request["folder"])
获取文件对象:
HttpPostedFile file = context.Request.Files["Filedata"]
1.先是在后台文章分类那里新建分类;2.打开数据库查找新建分类的category_id号码;(在数据库的iwebshop_article 表中)如下图:
3.接下来就是调用语句了;
{query:name=article where=category_id eq 2 and top eq 1 order=sort ASC,id DESC fields=title,id,style,color limit=8}
<dt><a href="{url:/site/article_detail/id}{$item['id']}">{echo:Article::showTitle($item['title'],$item['color'],$item['style'])}</a></dt>
{/query}
这是调用文章分类ID号码是2的示例。
4.调用语句说明:如果你调用的文章分类的category_id号码是3,那么在调用语句就这样写category_id eq 3 and top eq 1,然后替换上面语句中相同部分就可以了。
不需要隐藏域,直接用ashx来保存到数据库就行了
页面设置:
upload_url:../uploadnewspic.ashx?参数等ashx代码:
public class uploadnewspic : IHttpHandler, IRequiresSessionState{
public void ProcessRequest(HttpContext context)
{
HttpPostedFile file
string _fname=file.FileName
//保存代码略
}
}
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)