根据Review Id下载文件 [英] Downloading a file based on a Review Id

查看:108
本文介绍了根据Review Id下载文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的图书馆系统中使用两个表来显示书籍类别及其相关评论(例如,类别'ASP.NET'有评论'开始ASP.NET')。



现在我需要一个名为Files的第三个表来保存PDF文件。



使用此表我可以上传和下载.pdf文件。它的工作原理如下: http://imar.spaanjaars.com/414/storing-uploaded-files-in-a-database-or-in-the-file-system-with-aspnet-20



我的实体框架数据模型如下所示:

http: //postimg.org/image/iorpggn25/ [ ^ ]



使用文件表,上传的文件保存在VS中名为Uploads的文件夹中(生成的Id-s像这样 58e91f20-7c8f-4878-a7ac -315ab3a5353c.pdf )原始副本保存在文件系统中。



我是否需要与其他表关联?如果是这样,我需要什么关联以及哪个表加入Files表?在Review表中,所有评论都有Id-s,如: 1,2,15,20 ..等等。



我需要一个每个评论内的下载按钮和每个评论应该下载不同的pdf文件。



如何提供按钮或链接,所以点击时,它指向我到Uploads文件夹,我可以在那里下载那本特定的书。



如果评论有 Id = 5 和pdf文件 Id = 58e91f20-7c8f-4878-a7ac-315ab3a5353c ,如何将此pdf文件加入该评论并下载?

I'm using two tables for my library system to display books categories with their associated reviews (ex. Category 'ASP.NET' have a review 'Beginning ASP.NET').

Now I need a third table called Files which holds the PDF file.

Using this table I can Upload and Download .pdf files. How it works is described here: http://imar.spaanjaars.com/414/storing-uploaded-files-in-a-database-or-in-the-file-system-with-aspnet-20

My Entity Framework Data Model looks like this:
http://postimg.org/image/iorpggn25/[^]

Using Files table, uploaded files are saved on a folder called Uploads in VS (with generated Id-s like this 58e91f20-7c8f-4878-a7ac-315ab3a5353c.pdf) and the original copy is saved in the file system.

Do I need a association with other tables? If so, what association do I need and with which table to join the Files table? In the Review table all reviews have Id-s like: 1,2,15,20..etc,.

I need a 'Download' button inside each review and each review should download a different pdf file.

How can I provide a button or a link, so when click, it points me to the Uploads folder where I can download that specific book.

If a review have an Id=5 and the pdf file Id=58e91f20-7c8f-4878-a7ac-315ab3a5353c, how can I join this pdf file to that review and download it?

推荐答案

这篇关于根据Review Id下载文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆