الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

link to download pdf document

مغلق
بدأه fofgh في 20 مايو 2006 · 4 رد · 557 مشاهدة · في ASP.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

dear all

i have a hyper link to download a pdf document, the user click the link the save as dialog open

how can i do this ?

i try to put the path of the file in the hyper link but nothing happend .

thanks

#2

ما يحدث هو ما يلي... عند النقر على الرابط الذي يشير إلى ملف الـ PDF يتم فتح هذا الملف ضمن برنامج الـ Acropat الوجود على جهازك لذلك لا يظهر صندوق الحوار الذي يطلب منك حفظ أو فتح الملف ... هل هناك مشكلة فيما لو وضعت الملف ضمن مجلد zip بدلاً عن ذلك

#3

thanks for reply

i try to do that but also nothing happend ,

when i right click on the link and click the save as it's saved

#4
fofgh كتب:

dear all

i have a hyper link to download a pdf document, the user click the link the save as dialog open

how can i do this ?

i try to put the path of the file in the hyper link but nothing happend .

thanks

استعمل الشفرة التالية التي صنعتا وسوف تعمل على تنزيل الملف

Dim objFile As System.IO.FileInfo

		objFile = New System.IO.FileInfo(Server.MapPath("~/file.pdf"))

		Response.Clear()

		Response.AddHeader("Content-Length", objFile.Length.ToString())
		Response.AddHeader("Content-Disposition", "attachment;filename=file.pdf")

		Response.AddHeader("Content-Length", objFile.Length.ToString())

		Response.ContentType = "application/octet-stream"

		Response.WriteFile(objFile.FullName)

		Response.Flush()

		Response.End()

logo.gif
استضافة ويندوز


اقتباس

مساحة تبدأ من 2000 ميجا بايت بسعر 1.99 دولار شهريا.ا

اقتباس

ASP.NET 1.1-2.0-3.0-3.5-4.0-4.5.1 / MVC ASP.NET / PHP 5.x / ColdFusion / MSSQL 2008 & 2012 / MYSQL

#5

i'll try it thanks

هذا الموضوع مغلق.

مواضيع مشابهة