file

asp.net MVC Read from a http URL

i am trying to use this code: <%= File.ReadAllText(Server.MapPath("Members/newsletters/welcome.html"))%> which works great but now the welcome.html file has moved onto another server so i need to read it from an external URL . any suggestions? ...

python saving unicode into file

Hi all, i'm having some trouble figuring out how to save unicode into a file in python. I have the following code, and if i run it in a script test.py, it should create a new file called priceinfo.txt, and write what's in price_info to the file. But i do not see the file, can anyone enlighten me on what could be the problem? Thanks a lo...

How to test if a file is fully copied in .NET

I am monitoring a folder for new files and need to process them. The problem is that occasionally file opening fails, because system has not finished copying it. What is the correct way to test if the file is finished copying? Clarification: I don't have write permissions to the folder/files and cannot control the copying process (it's...

Internet Explorer Blocked download file

i use jquery post function to go to server and bring the link to file download. when the func come back and return the link, i try to open a popup or iframe with link source , to popup save/open file window i try this window.open(data.link,'Download','top=20,width=3,height=3,left=20'); or document.getElementById('download').src=...

LED master file

In LED (LatexEditor), how to mark a file (main_file.tex), containg includes of other files, as "main" ? If I right-click, I don't find this option in the menu. And if I make a copy named main_file.tex.latexmain, it doesn't work. ...

MyEclipse and making an EAR file

I made an enterprise application in MyEclipse, and it made three projects. The application name is Foo, and MyEclipse made these three projects: Foo, FooWeb, and FooEJB. I am able to deploy Foo in MyEclipse's server (which I set up as Glassfish), and when I expand the application in the server view in MyEclipse, I see the web and EJB mod...

Apache Webserver - How to write to dir/files with permissions set at 755 instead of 777

I just learned to install Apache 2 on my ubuntu linux localhost for the first time. I'm making it work with PHP5. I noticed that anytime I want to write to a file or directory, I have to chmod 777 the destination. But from my experience working on 3rd party hosting solutions, I am generally allowed to write to files and dirs that have...

jQuery - do you know any server file picker/uploader?

Hello there I'm building an application which requires the user to pick an image file from the images folder on the server. What I am looking for is a popup plugin that when clicking the browse button it will show a list of all files in the specified folder and return the filename of the selected file. Additionally (but not mandatory) i...

Can't save file on webserver: System.UnauthorizedAccessException

I can't save a file on my webserver with FileUpload.SaveAs() or with File.WriteAllText(). The folder I save in is CHMOD 666. My code is this: File.WriteAllText(MapPath(".") + "\\Ads\\test.jpg", "test"); This code works perfectly in Dev. server. Best regards, Lasse Espeholt System.UnauthorizedAccessException: Access to the path *' is...

ASP.NET Uploaded File

Hi, I have an ASP.NET web application that uses jQuery on client side. On one of the web forms I have a bunch of controls to fill, and an upload control. User can run upload while filling other entries on the form. When user saves the form, all data including file is stored into database . The question is what to do with uploaded file wh...

Read file that is used by another process.

Hi everyone. Is there ability to read file that is used by another process? Thanks. ...

Renaming a file using Java

Can we rename a file say test.txt to test1.txt? What if test1.txt exists will it rename? How do I rename it to the already existing test1.txt file so the new contents of test.txt are added to it for later use? ...

Printing to a UNC to emulate command prompt 'copy'

We have several applications that generate their own PCL and Postscript via C#. When it comes to print we've traditionally allowed for multiple outputs such as IP (LPR or RAW 9100) or local printer using: How to send raw data to a printer by using Visual C# .NET We also send via UNC (\\server\printer_share). The problem with the last...

Get NTFS file security info using Java or C++

Hi guys, I got stuck with this. I need to get permission info of NTFS files with Java or C++. Those info should be stored in Access Control List (ACL), but I don't know how to retrieve them with Java or C++. Thanks for your help! ...

reading integers from binary file in python

Hi there... I don't know if the question title is correctly set. I'm trying to read a BMP file in python. I know the first two bytes indicate the bmp firm. Next 4 bytes are the file size. When I excecute: fin = open("hi.bmp", "rb") firm = fin.read(2) file_size = int(fin.read(4)) I get ValueError: invalid literal for int() wit...

xml and files on disc interaction

Hi Guys and Girls, Its been a while since i've needed to do this so i was looking at the old school methods of writing XMLDocument from code down to a File. In my application i am writing alot to an XMLdocument with new elements and values and periodically saving it down to disc and also reading from the file and depending on the data ...

Efficient function for reading a delimited file into DataTable

Hi all, I was wondering if anyone knew of an efficient c# function for reading a tab delimited file into a datatable? Thanks ...

Best methodology for File Uploading :How does Youtube ?

What is the best method to follow for uploading files to server using my website ? Each user will upload some files to his profile.Should i place all files in a single directory or do i need to create folders for each user and keep the files there? How you tube is doing this ? Any idea ? How should i store the uploaded info in database.W...

Is there an easy way to add (#) to a filename when you find a duplicate filename?

I'm outputting files in C# and want to handle files being saved with the same name by adding brackets and a number: FooBar.xml FooBar(1).xml FooBar(2).xml ... FooBar(N).xml Is there a simple way to do that in .NET? And is there a special name for the (#) construct? ...

Appropriate way to add "media" files to c/c++ project in netbeans IDE

I have a a c/c++ project in netbeans 6.7 . The project requires a .dll file be located in the same directory as the .exe file, and it also needs a "media" directory (which contains a bunch of png files) within the same directory. I'd like to set it up so netbeans will automatically do this for me. How do I go about doing this? ...