I have been looking for a pretty simple setup for listing files in a directory. I found one, pretty straight forward and works in listing the files. But now i need to modify the code a bit to accomplish 2 things..#1 i need to enable the file names to be links to the file. Currently i have it linked, but points to the server file structure and not the website structure, by this i mean that when you mouse over a file, the link looks like this (file:///c:/inetpub/wwwroot/images/icons/current.gif ) and i need it to look like this ( www.site.com/images/icons/current.gif )#2 Currently for my test page, i have the path setup like this: DirectoryInfo dirInfo = newDirectoryInfo(Server.MapPath(@"imagesicons"));Is there anyway to get the current path for that page, so i dont have to hard code the directory for each page i need this setup on? Also, how can i update the part for the file types to display, i need to display 3 different types, so notsure how to update that line either.Here is the ASPX and Code behind i have setup.
I am planning to create a web page with the name of the student, course,pic and the resume to be uploaded by the user for specified students...
If I upload the resumes of students with same name how to differentiate. Looking for creating a name of the file name randomly as next I'm planning to retrieve the resume via search function to download and view the resumes....
Saving the resumes with same name with differentiate or randomly to save the files with new file name....
I need to Keep track of folder names as linksactually this is not site navigation.we r displaying the folders/subdirectory names as links on the webpage.the task is -(a) on pageload I need to display the main folder - this is fixed(b) the subfolders and files r displayed in a grid.if I click on a folder link the breadcrumb need to be updated.(c) if I click on a link in the breadcrumb the grid should be updated as well as the breadcrumb has to be updated.need breadcrumb examples suitable to my above requirement.
I've got a script below that uploads multiple files and works fine. I am trying to rename them as I upload them and I'm having some trouble figuring it out.
I have a folder with 200+ pictures. I want to get the names of each of the pictures to the database. would it be easier to import and export the images into the database (I want my webpage to be able to show the images once they are in the database)?
I have many images on remote server say [URL] & i want to access file names of all files that resides in the folder 222 on [URL]
i have tried following code but getting error "virtual path is not valid" :
imageserver = http://images.foo.com/222; DirectoryInfo di = new DirectoryInfo(imageserver); // line giving exception FileInfo[] rgFiles = di.GetFiles(); string simagename = ""; if (rgFiles.Count() > 0) { foreach (FileInfo fi in rgFiles) { //collect each filename from here } }
I've seen in some sites where the url displays without a file name and am curious how I go about doing that.
instead of http://mydomain/myapp/index.aspx i'd like to have http://mydomain/myapp
I'm also curious how to prevent a user from copying a link's shortcut, but not necessarily disable right click altogether. The idea is that I don't want users to get to pages in the site without first going to the home page.
I have the following code i found online and it works fine as long as the sheet names are simple names it seems..
If i have a excel file with a sheet name of (sheet1) the code works.. but if i have a file with a sheet name like (FileName2011_03_03_15_01_43) it fails and causes the rest of my code not work..
I have a HTML file which I want to load, say in a Label control. This HTML file have a series of unordered list, which acts as a vertical menu links for the various sections of the file.Now, I have no idea whether these links, inside the HTML file, will work if I load it on Label control. Is there any other way of doing this ? I want those links to work when the file gets loaded.
anybody working on data exporting? I've 4 tables in my sql server database. I want to export these 4 tables data into one excel file in different sheets with column names.
I have a site that allow the user to request a secret report in a pdf format. My idea is to put the generated pdf files in a public folder with disabled directory browsing. Each file name consists of 128 characters that are uniquely and cryptographically generated. The legitimate user will be given the link of his/her own report.
I have a gridview with a Download button that serves a download to a user. I put it in App_Data so its secure so people can't try to download it. However, when I use this code, the save as dialog box pops up, and when i hit save as, the file immediately finishes loading - and it's just 0 bytes. The file is 5 Megabytes.
I currently have an asp.net page which a loggd in user goes to and theres a bunch of dynamically generated links to zip files that he or she owns and can downloads.Currently they click download and I have no way of knowing if it completes succesfully etc so can't log it. I do log the attempt.Is there are good download manager or solution I can use so they will have progress bars on the site, they can queue multiple ones up and most importantly I can track failed and successful downloads.
I'm working on an ASP.NET application. Currently when the user clicks "Save" on an item, we disable the Save button, change its text to "Saving..." and so on. This works fine, because the button causes a postback which results in a new page being loaded, on which the Save button is no longer disabled.
We now want to apply this to other actions: Publish (not much different from Save), Import (again, much like Save, but based on data the user has uploaded in a previous step), Export (downloads an XML file to the user) etc.
Export is causing me problems - the button stays disabled. I think this is because the server sends back an XML file rather than a new web page, and so the browser just displays the same page.
a way of making the server send a fresh page back in the response as well as the XML, thus re-enablnig the button in the same manner that the other pages do, ora way of getting the browser/JS to re-enable the button once the file has been sent.
I used temporary download link that users can download their files with limit speed but here they can't pause their download and start it later see below image
I want active resume capability how I can do it...
I have used a FileUpload control in my web page. Now I want that when the textbox of the control is blank (i.e no file name mentioned), the upload button should be disabled. Only after the some file name is mentioned, the buttong should get enabled.
I tried this code by inputting the ftp address as ftp//: and the correct username and password and I get the following error
"Unable to connect to the remote server" on line :
FtpWebResponse Response = (FtpWebResponse)Request.GetResponse();I tired this on my ftp server provided by a hosting service and an anonymous ftp located at 193.166.120.5 ?
Note: I was able to connect to both of these ftp through filezilla, via a webbrowser, and through windows command line.
I would like ask you for some ideas how can I write mechanism that will be automatically read files from folder. I don't know how to schedule the write task. I want to check for new file everyday and if the new file is in the folder read it.
I have an asp.net panel having various controls including gridview. I have converted this panel into pdf and attached it as an email attachment using memory stream. Everything is working fine. Now I have an File upload control outside panel through which I have to attach a file and send it in mail along with the already attached panel. But I am unable to figure out how to do it.
I am downloading file from database using the following code. This code downloads an excel file from the database which has a macro attached to it when it is opened. This macro reads file name of the excel file and uses it for its computation. Everthing works file if user saves the file on his harddisk and then open if but if he directly opens the file from the dialog(by hitting 'Open' button) then file name of the opened excel file comes out be the name of the webform that has the above code and this leads to error in the macro. Is there any option through which i can control the name of the file if user directly opens the file from dialog or the option to disable or remove 'Open' button form the dialog?