file

Question about the use and scope of global.asax (for file cleanup after application ends)

Hey guys, I apologize for this basic question, but for the life of me I can't seem to find an answer. I previously asked a question here about how to dynamically store temporary images and handle their cleanup on a web server's file system. (using C# in .NET 3.5) It was suggested that I use a global.asax file to handle this. I just...

symlink-copying a directory hierarchy

What's the simplest way on Linux to "copy" a directory hierarchy so that a new hierarchy of directories are created while all "files" are just symlinks pointing back to the actual files on the source hierarchy? 'cp -s' does not work recursively. Thanks! -Max ...

HTML file input field with limited file types?

If I have an HTML file input field, is there any way that I can limit it to only allow image uploads? I'm sure this would be possible with Flash or Java, but I'm trying to stay away from them for the time being. I found the "accept" attribute online, but it doesn't seem to be doing anything for me (or I'm using it wrong.). Any help or...

Write to XML in ruby

I am completely new to Ruby. All I want is to produce a simple XML file. <?xml version="1.0" encoding="ASCII"?> <product> <name>Test</name> </product> That's it. ...

File upload permission problem IIS 7

I am unable to upload files to website hosted under IIS7. I have already given write permissions to "IUSR_websitename" and set the property in web.config also. I am able to upload files with out log in to application at the time of user registration. But once log in to application, if I upload files, it is giving "Access denied" error....

Accessing .exe file within .jar

Hi everyone! I recently created an application and successfully jarred this to c:/my/folder/app.jar. It works like a charm in the following case [Startup #1]: Open cmd cd to c:/my/folder java -jar app.jar But when I do this, it doesn't work [Startup #2]: Open cmd cd to c:/my/ java -jar folder/app.jar Because app.jar contains a ....

Maximum server file access frequency

I'm trying to create a AJAX push implementation in PHP using a Comet long-polling method. My code involves using file_get_contents() to read a file repeatedly to check for any messages to send to the user. To reduce server load, I'm using two text files; one containing the actual command and one acting as a "change notifier", which eithe...

How to read a text file upto certain position in C?

I am passing a string as an argument to my program and extracting its position in a text file. Can we read a text file only upto this certain position in C?? If yes, then please tell me how. ...

File upload iis7

Hi, I have a website and my users can browse the website for general information. If user wants to post any data, they need to register in the website. At the time of registration (in registration form) they can upload their photo. Once registration process is completed they can even modify the previously uploaded photo. My users are f...

Howto: Drupal File Upload Form

I'm having difficulty figuring out how to write a module with a form that uploads files, in Drupal 6. Can anyone explain this, or point me to a good example/documentation discussing it? EDIT: Here is entirely what I am trying to do: User uploads a .csv Module reads the first line of the file to get fields User matches csv fields with...

Property file string length limitation (JAVA)

Hi %, playing around with a property file i figured that there seems to be a limitation of 40char to save in a single property. I do the following: File configFile = new File("config.properties"); Properties props = new Properties(); props.put( "cc_server", "sort_of_a_long_string_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

How to read partial data from large text file in C++

I have a big text file with more then 200.000 lines, and I need to read just a few lines. For instance: line 10.000 to 20.000. Important: I don´t want to open and search the full file to extract theses lines because of performance issues. Is this possible? ...

File:// link doing nothing in all browsers

I have a link being generated that looks like so: <a target="_blank" title="Test" href="file:///c:/test.xls">Test</a> This link is inside an iframe. When I click on it (in any major browser), nothing happens. Fiddler records no traffic. Pasting the URL into the nav bar works fine - the file download box comes up, and I can download ...

How to use javascript to determine whether a file exists in a directory?

Hi everyone! How to use javascript to determine whether a file exists in a directory? ...

How can I test whether a file has been opened for writing in Perl?

In my apps, I need to check whether a given file has been opened for writing for another process, and even this file has been opened my app just skip this file and no "die"-like things will happen here. more detailed description of my problem: there are two process involved. process A , which is the producer process, process B which i...

folder monitor in java?

Is there a way to monitor folders in java to see when they are updated, ie file created, deleted, renamed,etc. And also is there any way to set it that it only looks for files that begin with a certain prefix, ie img? ...

Encrypt SQLite database in C#

What is the best approach to encrypting a SQLite database file in .Net/C#? I'm using sqlite-dotnet2 wrapper. There are tools like SQLite Encryption Extension and SQLite Crypt, but both are non-free, while my project is under GPL. The naive approach I thought of using was to let SQLite handle a temporary file, then to encrypt it on pro...

When using Trac and SVN together, how will I know that a file is committed to solve a certain ticket?

For example, a file is modified to do an enhance ticket, what I want to do is associated the committed file to the ticket. When using Trac and SVN together, how will I know that a file is committed to solve a certain ticket? Is this possible? Thank you. ...

Html file upload preview by Javascript

I want to show a PREVIEW kind of thing for an post , so took details by JS but problem comes when it comes to <input type="file" , it's not giving full path to the file Ex: if I do $("#image").val(); it only give "Sunset.jpg" not C:\Documents and Settings\All Users....\Sunset.jpg any idea how to get that detail value? ...

How to open file in Windows while not blocking its renaming

Is there a way to keep a file open, while not blocking its renaming by another application? Keeping the file open does not block its renaming in Unix. Can I achieve the same behavior in Windows? ...