如何处理像gmail这样的文件附件 [英] How to handle file attachment like gmail

查看:68
本文介绍了如何处理像gmail这样的文件附件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



i想要像gmail或其他任何电子邮件一样附加文件,请不要因为我已经通过jquery完成多次上传而混淆。

我的问题是假设我有两个名为test.jpg的文件,内容不同,如果我从我的gmail帐户发送它,如果我附上这些文件[同名]那么它会成功附加,接收者也会得到两个文件具有不同内容的相同名称。

现在如果有一个文件重命名机制在后面完成,那么接收器如何下载具有相同名称的两个文件。

我有一个asp.net应用程序执行此任务,如果我附加名称为test.jpg的文件和将其重命名为123.jpg和456.jpg之后存储,那么如果我将其存储在名为UplodedFiles的文件夹中则没有问题。但是当我下载它时,新的名称(无论我重命名两个文件)都显示给用户,但我不想要这个。

i希望这些文件显示两次给用户,其原始名称为test.jpg [但实际上,如果我将其上传到同一位置同名,则最后一个将被删除]。

如何完成这项任务。



希望你理解我的需要。

Hi,
i want to attach files just like in gmail or any other email, please don't confuse here for multiple uploading as i have already done it by jquery.
My problem is that suppose i have two file named test.jpg with different content and if i send it from my gmail account and if i attach these file [same name] then it will successfully attached and the receiver also get two files with same names with different content.
Now if there is a file rename mechanism is done in back side then how both files with same names are downloaded by receiver.
I have an asp.net application to do this task and if i attach both files whose names are test.jpg and stores after rename it as 123.jpg, and 456.jpg then there is no problem if i store it on a folder named UplodedFiles. But when i download it then the new name (whatever i rename both files) is shown to user, but i dont want this.
i want that these files shown two times to user with their original names as test.jpg [but actually if i upload it on same location with same name then the last one will be deleted].
how to do this task.

hope you understand my need.

推荐答案

问题不明确。所谓的附件实际上是嵌入在单个邮件中的部分。要撰写邮件,您可以使用类 System.Net.Mail.MailMessage

http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.aspx [ ^ ] 。



在上面引用的页面上显示的代码示例中,演示了附件的创建。



-SA
The problem is not clear. What's called "attachments" are actually the parts embedded in a single mail message. To compose a message, you can use the class System.Net.Mail.MailMessage:
http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.aspx[^].

In the code sample shown on the page referenced above, creation of an attachment is demonstrated.

—SA


这篇关于如何处理像gmail这样的文件附件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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