Web Forms :: Opt User To Set Path To Save File?
Jun 18, 2010
i am using a sample code to save the data from the text boxes to a text file and i am saving it in to a directory. This one i hard coded to save the text file. Now i need to save it in a particular directory that user sets. Like i will opt him an option like preferences in menu there he can set a path to save his file and i would like to save the files in that path he created. And also if he changes the directory i would like to move all the files to that drive he opted. [URL]
View 5 Replies
Similar Messages:
Apr 30, 2010
am a newbie to programming so please bare with me!I introduced a file upload control on one of my pages. There is a button click event for the upload which triggers not only the upload but also an insert into a table in my database.Every aspect of the button click event for this upload is working as expected; however I do have a couple of queries because the results are not quite as I would like them. I am using asp.net 3.5 and C# in code behind page.
I have a simple table with 3 columns in my database: Username, PhotoTitle and PhotoUrl. In the button click event I grab the PhotoUrl like such -string photoUrl = FileUpload1.PostedFile.Filename; (I am using the photo url from my images folder in the application to show photos in Gridviews etc. I prefer this to storing the actual image in the database for the moment until i am a bit more experienced since i don't know much about varbinary dbtype.). When the button is clicked for the upload, the details of the photo are saved in the database table, but it's the full path of the file on my laptop which is store (C:/Documents/.../filename.jpg) opposed to "Filename.jpg" for example, which i obviously would prefer because in the application photos are displayed using the"~/images/Filename.jpg" path. How can I save the file name with the extension alone in my table (without the full path)?
The second problem is basically regarding the actual photos being uploaded. They are"saved as" inside folder for the solution as anticipated, but only on the laptop harddrive, which means that I have to manually drag each photo uploaded into the images folder within Solution Explorer, from a Windows Explorer window, in order to be able to display them in Gridviews etc (with the "~/images/Filename.jpg" call in the .aspx code). This is not acceptable of course since the site users would expect to see their photo after the upload, and they would not be able to drag the file into the ~/images/ folder. How can I get round this second slight problem; i.e. is there a way to upload photos directly in the folder so that they show directly on the solution explorer?I hope my explanations of those two little problems I have didn't confuse you all?
View 10 Replies
Jan 22, 2010
I have a file uploader I would like to be able to have a folder added to the folder path on upload based on a textbox.text "MapPath("~/Uploads/" + Path.GetFileName(e.filename))"
I have Dim folder as String = textbox.text how do I add folder to MapPath("~/Uploads/"
it currently checks for .xml files how can I add more .doc .gif etc
Dim savePath As String = MapPath("~/Uploads/" + Path.GetFileName(e.filename)) 'Validation for file extension If Path.GetExtension(e.filename).Contains(".xml") Then Return End If
View 2 Replies
May 7, 2015
I want example upload pdf file and send name, title, filename, filepath to database and retrieve and display pdf from Upload Folder...
View 1 Replies
Apr 26, 2010
how can we save the uploaded file path in to database and then retrieve it in gridview as a link so when user click on that it will open that file in browser.
View 8 Replies
Apr 21, 2010
I am running Windows Server 2008 Datacenter, ASP.NET 4, IIS 7 and getting the error :Access to the path <path> is denied when using the FileUpload control to save the uploaded file to this directory.I have given the directory in question full access to Network Service but that makes no difference.I have even given the directory full access to Everyone but it still gives the same error.Totally baffled by it
View 1 Replies
May 7, 2015
I want to save three images path in table also upload images in folder,how it is possible?[Using ajax file upload control]table columns are imagepath1,imagepath2,imagepath3. URL....
HTML
<asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server" AllowedFileTypes="jpg,jpeg,png,gif"
MaximumNumberOfFiles="3" OnUploadComplete="File_Upload"
Width="500px" />
C#
protected void File_Upload(object sender, AjaxFileUploadEventArgs e)
[code]....
View 1 Replies
Dec 15, 2010
My Asp.Net calls a SQL sproc and returns a XML file as a string. This is what I need to do:
- save that string into memory (as a file);
- pop up a dialog box asking the user which path he would like to save the file;
Any samples out there...how do I achieve this task in Asp.Net C#?
View 4 Replies
Jan 29, 2011
I have a form where users can store some data for archived documents. All documents are ONLY in PDF format.
There are 2 things I would like to do:
1. there is a "file path" text box on the form. I would like to open a "browse file dialog" box when user clicks the textbox and then the user browses for the file (file is on the users local machine) and selects it. The full file path should be saved to the textbox as string (e.g. "c:archive2010document11122011.pdf"). Also I would like to "limit" the file browser dialog to only show PDF format files...
2. add a code behind command to open the file from the saved path+name (see 1.) in the user's default PDF viewer (Acrobat or Foxit)
View 11 Replies
May 7, 2015
[URL] .... I am referring to the link given mentioned above, i want to save image details into database of each file, if i select two files i want to save filename in database in each row. ist file in 1 row , second file in next row with file name.
View 1 Replies
May 7, 2015
How To Save Video files into folder and save path only into database in asp.net using c#.
View 1 Replies
Jan 19, 2011
I'm trying to write code that will allow a user to click a button and be prompted to save an image file that resides on the web server. I'm using the following code, but I get an error that says "Error: Could not complete the operation due to error c00ce514.".
[Code]....
I have verified that the file exists. Is there another method for prompting users to save a file to their local machine?
View 3 Replies
Dec 21, 2010
I have a webpage that allows a user to download a specified file. When the file is ready to be fully downloaded (i.e I call the HttpResponse.End or HTTPRepone.Flush) the user is presented with a File Download dialogue.
Is there any way to determine what option the user has selected?
Have they Opened, Saved or Cancelled the File Download once the Flush or End has been sent?
View 3 Replies
Jun 29, 2010
I want to get full path which user selected in file upload control.
how can we do it.
View 3 Replies
Oct 22, 2010
i am new to this, would like to ask how can i check which button user click when downloading file, either open, save or cancel ? I need to update to the Database after the user click the save/open button, if cancel, then do not do anythinghere is example of code:
void Page_Load(object sender, EventArgs e) {
View 9 Replies
Jan 4, 2014
What is the best way to insert and retrieve images like :
In the database in binary form retrieve it with imagehandler, or
In the database by saving the path of the folder of the images and retrieve it, or
by saving the images directly to the folder and retrieve it...
View 1 Replies
Dec 2, 2010
I'm working on an application (ASP.NET, Webforms) that generates a list of outputs based on a user input. I want to allow the user to save the contents of said list as text file, or possibly as other filetypes such as .csv. What is the best way to approach this? Can it be done client-side with Javascript?
View 2 Replies
Jun 1, 2010
I need to save the selected File in my this location.My Actual path is this \zdcprojectCCHIS_NCHS_NVSSDEVNDI.When I add actula path its not accepting. I am getting this message 'unrecognized escape sequence'.So I replaced with with '\' . When I am executing its returing this path 'Failed to map the path '/zdc/project/CCHIS_NCHS_NVSS/DEV/NDI/'.How can I save my actula path.
[Code]....
View 3 Replies
Jan 19, 2011
I have a standard FileUpload control, which calls a class library, where the file becomes HttpPostedFile. In beta versions of my page, I've been able to successfully use HttpContext.Current.Server.MapPath(filename)to save the file. The class library does various functions, including saving the image into /uploads and a thumbnail into/thumbs.
But now, after tidying up the layout of the site, the upload aspx page has moved to a subdirectory 'members'. I had assumed (wrongly) that calling the upload function would act as normal. However, now I receive an error because of where the page is originating from: The code wants to save the file in the non-existant folder /members/uploads and /members/thumbs
My question is: Apart from hard-coding the directory structure of my hosting provider, is there any way to use an equivilent to server.mappath which will recognise the root path of the website, and ignore sub-folders?
One method which solves my problem is to append "../" to the start of the file location, eg HttpContext.Current.Server.MapPath("../" & filename) ...However, as many pages will be able to call the upload class library (and not all of them in a sub-folder) I want to make sure I'm not always back-tracking on the subfolders.
View 2 Replies
Feb 16, 2013
can we save pdf document without save,view,cancel dialogue box in asp.net..
View 1 Replies
Feb 3, 2011
i have place some .txt files in my web application root directory. now i want to open a popup on button click with save button so that client can save this file on his/her PC. also can we auto set the path??? mean client jst press save button and file automatically stored his "D:\Foldersample.txt".
View 1 Replies
Sep 15, 2010
I am using to send attachent from my host.. The file is located on my abc folder on my root, so it' like this:
root/abc/myfile.doc
Attachment attachFile =
new
Attachment(txtAttachmentPath.Text);
How can I assign the path in the above code?
View 1 Replies
Jan 24, 2011
i have uploadfile and image control,. i wnt to upload an image and displayit in the image
but i face error message that said:" The Save As method is configured to require a rooted path, and the path '~ImagesfileName.jpg' is not rooted."
this is my code:
[Code]....
View 4 Replies
Sep 2, 2010
Is there any control which has to browse folder path alone instead of selecting folder path + file ?any server side or client side control ?
View 1 Replies
Jan 6, 2011
I am using HTML file control and HTML image control in .aspx page (for uploading image and showing on web page). It is working fine. But I am unable to get that uploaded image file path and file name in .aspx.cs page. And also tell me how to save selected image in MS ACCESS database.
View 4 Replies