Click here to Skip to main content
14,574,094 members

Web Development

 
PinnedHow to get an answer to your question Pin
Chris Maunder4-Sep-10 2:25
cofounderChris Maunder4-Sep-10 2:25 
PinnedHOW TO ANSWER A QUESTION PinPopular
Chris Maunder12-Jul-09 22:40
cofounderChris Maunder12-Jul-09 22:40 
QuestionRust Language Rocket Framework Pin
Saim Irfan15hrs 57mins ago
MemberSaim Irfan15hrs 57mins ago 
AnswerRe: Rust Language Rocket Framework Pin
ZurdoDev15hrs 41mins ago
mveZurdoDev15hrs 41mins ago 
Questionwhat would you recommend me to use graphs in PHP+MySQL? Pin
Joan M18-Jun-20 9:49
professionalJoan M18-Jun-20 9:49 
Questionnode js express redirect from http to https Pin
ok2113-Jun-20 1:45
Memberok2113-Jun-20 1:45 
QuestionPlotting points on interactive map Pin
StampedePress9-Jun-20 5:07
MemberStampedePress9-Jun-20 5:07 
AnswerRe: Plotting points on interactive map Pin
Saim Irfan16hrs 3mins ago
MemberSaim Irfan16hrs 3mins ago 
Questionweb development Pin
moustafa arabi6-Jun-20 3:39
Membermoustafa arabi6-Jun-20 3:39 
AnswerRe: web development Pin
Mycroft Holmes6-Jun-20 12:07
professionalMycroft Holmes6-Jun-20 12:07 
QuestionHow to successfully Async download a pdf file to a client PC vb.net web application Pin
Amer Amer5-Jun-20 22:47
MemberAmer Amer5-Jun-20 22:47 
I don’t know if this question belongs to this forum.
I'm developing a website with vb.net web application using visual studio 2015 where a client is able to download a pdf file and I have considered 2 approaches as follows.


Dim sqlcom As New SqlCommand("select bookcontent,bookname from books where  bookn=" & Page.RouteData.Values("bookn").ToString & "", conn)
        Dim da As New SqlDataAdapter(sqlcom)
        Dim ds As New DataTable
        da.Fill(ds)
        Dim filename As String = ds.Rows(0)("bookcontent").ToString
        Dim fff As String = ds.Rows(0)("bookname").ToString
        Dim fileInfo As FileInfo = New FileInfo(filename)
        If fileInfo.Exists Then
            Response.Clear()
            Response.Buffer = True
            Response.Charset = ""
            Response.Cache.SetCacheability(HttpCacheability.NoCache)
            Response.ContentType = "Application/pdf"
            Response.ContentType = "application/ms-word"
            Response.AddHeader("Content-Disposition", "inline; filename=""" & ds.Rows(0)("bookname").ToString & ".pdf" & """")
            Response.AddHeader("Content-Length", fileInfo.Length.ToString())
            Response.TransmitFile(filename)
             Response.Flush()
            HttpContext.Current.ApplicationInstance.CompleteRequest()


I'm having trouble with the first approach above because when downloaded start the website
Hang on until pdf file fully downloaded to client PC ,this is bad since website will be access
By thousand of users every day,so I want to make the download process asynchronous.
I use the .NET Framework WebClient class in the second approach:


Dim Client As New WebClient
Dim weburl As String= ....here is some procedure to get url 
Client.DownloadFileAsync(New Uri(weburl), @"c:\myfile.pdf")


But the problem here is that a path must be set and I want clients to get the file in the default download folder according to the Internet browser they use and the download process not appear through browser user can't see downloading file progress .
I will very much appreciate any comment that points me in the direction to solve this issue.
Thanks a lot.
AnswerRe: How to successfully Async download a pdf file to a client PC vb.net web application Pin
F-ES Sitecore6-Jun-20 2:40
mveF-ES Sitecore6-Jun-20 2:40 
AnswerRe: How to successfully Async download a pdf file to a client PC vb.net web application Pin
Richard Deeming8-Jun-20 0:24
mveRichard Deeming8-Jun-20 0:24 
GeneralRe: How to successfully Async download a pdf file to a client PC vb.net web application Pin
Amer Amer8-Jun-20 4:11
MemberAmer Amer8-Jun-20 4:11 
QuestionGoogle SignIn and regular account, using the same email Pin
jkirkerx2-Jun-20 12:53
professionaljkirkerx2-Jun-20 12:53 
QuestionWhere can passwords for webpages be stored, except in browser itself and Credentials Manager? Pin
arnold_w18-May-20 21:23
Memberarnold_w18-May-20 21:23 
AnswerRe: Where can passwords for webpages be stored, except in browser itself and Credentials Manager? Pin
Richard Deeming19-May-20 0:22
mveRichard Deeming19-May-20 0:22 
GeneralRe: Where can passwords for webpages be stored, except in browser itself and Credentials Manager? Pin
arnold_w19-May-20 9:16
Memberarnold_w19-May-20 9:16 
GeneralRe: Where can passwords for webpages be stored, except in browser itself and Credentials Manager? Pin
Richard Deeming19-May-20 9:25
mveRichard Deeming19-May-20 9:25 
QuestionPHP: Filtering a Wordpress admin post list by role Pin
TectonicEng17-May-20 4:30
MemberTectonicEng17-May-20 4:30 
SuggestionRe: PHP: Filtering a Wordpress admin post list by role Pin
Richard MacCutchan17-May-20 5:44
mveRichard MacCutchan17-May-20 5:44 
QuestionPowershell timer question Pin
Member 144746071-May-20 10:31
MemberMember 144746071-May-20 10:31 
QuestionWeb API Design Question Pin
Kevin Marois30-Apr-20 8:33
professionalKevin Marois30-Apr-20 8:33 
Questionweb creation Pin
Member 1480564017-Apr-20 22:01
MemberMember 1480564017-Apr-20 22:01 
AnswerRe: web creation Pin
OriginalGriff17-Apr-20 22:13
mveOriginalGriff17-Apr-20 22:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.