i got a field that contains txt files in my access database.
i want to display this txt file on my page. how can i read the file and display it exactly as it in file written? In which asp component can i display it? I know some methods to read file but they don't work as i want. my text files have a format and i want to display them so in my page.
Thanks
Solved!
it was very easy. i am giving the path to the file and just calling Response.Write(pathToFile)
in template.
Related
I am using OneupUploaderBundle, with jQuery File Upload. After the files are selected, they are uploaded and renamed by the bunudle. The problem I am facing to, is from the validation of my form(entity) how can I know the list of files that have been uploaded ? I don't know which kind of parts of code can be useful for this question as I have just followed their guide but I can edit if needed.
So the solution I've built is to add the picture filename, via the EventListener used for the file posting, in a text file, then explode the text file in an array from the controller (form validation) and move the pictures files to their final location. If someone as a better solution... Do not hesitate!
How do i create a file from page request
Lets say if i'm on Page A and need to have the file from Page B.
Page B returns a .XLS file format on the fly with response.output.
How do i get this as an File i need to attach this to an attachment i dont like
copy the whole code from Page B since i dont think thats realy needed.
ive tried a WebGetter but that does'nt realy works that well.
if you have any tips or snippets that would be awesome.
I code in VB.net.
Regards,
Stefan
I have a project that needs to upload a large file, while that file is uploading is it possible to progress through a series of other screens, to continue to obtain input from user, then once they get to the final screen, file is uploaded.
Anyone have a trick for something like this ? As i know the file upload happens within a form post/get.
You can do this using an iframe, which simple links to a page with a form to post a file, once the user has selected a file and clicked upload/submit you can hide the iframe and progress into our areas... but things will get tricky where you need to handle errors, ie: incorrect file formats, zero byte files etc... maybe you can download the file and display any errors right at the end of your process/wizard input.
I am using an ASP.NET FileUpload to upload files to the server. How to upload it to the rootfolder of my project. I want to add the files to a collection or list of files to be shown on the webpage in the form of gridview. Each file should have a link to itself in the list So that it could be downloaded by the click-if desired. The gridview will also have a delete column so that I can delete any of the corresponding file-as desired. Can anyone help me to achieve this easily-without javascript or ajax
There are two ways to do it:
Simple way: create a sub-folder where you'll place your files and use DirectoryInfo.EnumerateFiles to list them.
Complex (but better) way: create a sub-folder where you'll save your files, outside of the web site, when a file is uploaded write an entry into a database, specifying the file's name (and maybe some other useful informations, e.g. size, type, etc), in your page you list the database entries, and when a user clicks on one of the links you serve the files through an ASHX handler. This way you have access control on who can download the files, and can track statistics.
I have a webapplication for uploading and showing files(Image and video).The administrator can upload files and the users can view this files.Now i am inserting the details of file to the sqlserver and populating links for the corresponding file in the user's form.There may have images and videos.
I want to categorize the image and
video files;ie ,i want to show files
in two separate folders(Images and
Videos)
.This Categorizing also in sql(there should have a category table and it should be related with fileM table.
If anyone can help me please..
thank you
You need to detect the mime type of the file. Have a look at this question in stackoverflow..
How should I detect the MIME type of an uploaded file in ASP.NET?