473,396 Members | 1,895 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

save file dialog window from a web page

What is the appropriate control or code to pop a "save as" dialog window to
allow the user of a web page to save a document after they click on a link?
All of the CommonDialog controls obviously are to be used on WinForms, so not
sure how to accomplish this from an aspx page.
Sep 10 '05 #1
2 7406
From ASPFAQ

http://mosley.arach.net.au/dev/docs/save%20as.htm

"rmunson8" <rm******@discussions.microsoft.com> wrote in message
news:35**********************************@microsof t.com...
What is the appropriate control or code to pop a "save as" dialog window
to
allow the user of a web page to save a document after they click on a
link?
All of the CommonDialog controls obviously are to be used on WinForms, so
not
sure how to accomplish this from an aspx page.

Sep 11 '05 #2
rmunson8 wrote:
What is the appropriate control or code to pop a "save as" dialog
window to allow the user of a web page to save a document after they
click on a link? All of the CommonDialog controls obviously are to be
used on WinForms, so not sure how to accomplish this from an aspx
page.


There was no way for you to know it, but this is a classic asp newsgroup.
While you may be lucky enough to find a dotnet-knowledgeable person here who
can answer your question, you can eliminate the luck factor by posting your
question to a group where those dotnet-knowledgeable people hang out. I
suggest microsoft.public.dotnet.framework.aspnet.

Here is an aspx page html that allows the client's file system to be
browsed:
<form id="Form1" encType="multipart/form-data" runat="server">
<INPUT id="uploadedFile" type="file" name="uploadedFile"
runat="server">
<INPUT id="upload" type="button" value="Attach" name="upload"
runat="server" OnServerClick="Upload_Click">
</form>

Here is the server-side code that handles the posted file:

Sub Upload_Click(ByVal source As Object, _
ByVal e As EventArgs)
If Not (uploadedFile.PostedFile Is Nothing) Then
Try

Dim savePath As String = _
Server.MapPath("SavedFiles") & "\"
Dim postedFile As HttpPostedFile = _
uploadedFile.PostedFile
Dim filename As String = _
Path.GetFileName(postedFile.FileName)

postedFile.SaveAs(savePath & filename)
Catch exc As Exception
message.Text = "Failed uploading file"
End Try
End If
End Sub

cp'ed and followup-to set to aspnet

HTH,
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Sep 11 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Soph | last post by:
Hello, I would like to add a text field to the bottom of the Save File Dialog Box when it is displayed. Is this possible to do this in Visual C# .NET? Thank you for your assistance, Soph
1
by: Kapil | last post by:
Hi All can u tell me how to save dynamically generated file in asp.net. like save file dialog in asp.net. kapil
6
by: Thomas Schoch | last post by:
I want to add a combobox to the save file dialog, where the user can choose an additional option. How can this be done in VB.NET? Thomas
21
by: iwdu15 | last post by:
how can i create a code to make my program create an rtf file? heres what i have so far, any help would be appreciated: Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As...
4
by: Jonny | last post by:
Hello Group How do I open a Save File Dialog from an ASPX page behind a browse button? Any help would be fantastic!! I am using ASP.NET 1.1 using VB.NET as the coding language TIA
5
by: shailendra kumar | last post by:
Hello Friends I want to open a Save as File Dialog Window by clicking on a button.
0
by: Hayk Rustamyan | last post by:
Hello, I want to open a Save as File Dialog Window in ASP .NET/C# by clicking on a button. -- Best, Hayk Rustamyan
3
by: vedika | last post by:
hi, I created one application in which there is export functionality. I am using sqlCE as database . When user click on "export" a save file dialog appeare and file saved in html format from...
1
by: mihir0288 | last post by:
I want to save HTML file that i open in web browser on my hard disk without using save file dialog box. I want to save it as html page through only code and without user interactions.
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.