files

copying a text file- c++

I'm copying over text from one file to another, with certain changes. I have input.txt, tmp.txt and output.txt. The idea is to copy a few lines over to tmp.txt (until we reach a delimiter), move the text from tmp.txt to output.txt, wipe tmp.txt and then continue the cycle until we reach the end of input.txt. I'm having trouble with ...

How to download a file and immediately serve it to the client in ASP.NET?

Basically I need to serve files from a location that requires windows authentication. Instead of having my client's deal with it directly, I would like to implement a process so that they can simply download the files as if they were on my server, after they have logged in to my system, of course. Here is what I have so far, which does...

Http upload, save the mod/write date?

On my website i can upload files. I then use file[indx].SaveAs(path) to save the file however i notice the modify date is the current date and the creation date is 1second after that. Is there a way i can get the correct modify/write date from the client? ...

form validation in django

In which file or form should validation code be written ? ...

Programmatically adding security permissions to files in C#

Hello, In an asp.net app, I have a task that ftps some xml files down to a local folder on my computer. I then want to read those files but when they're copied to my local folder, they don't have the Network Service user account set up. So, my question is how, in .Net C#, do you programmatically add the "Network Service" account with fu...

drupal file sharing

Hi, I am finding a drupal module to enable file sharing between users, somebody know someone??? ...

How to copy multiple files from server to local hard disk in one http request using C++?

How do you copy a group of files from server machine to local hard disk through a C++ web application in one request? This is kind of downloading bulk files to your local machine from a server. I guess in Java you could do this through ZipInputStream and GZipInputStream. Is it possible to achieve this entirely through server side code? ...

Handling multiple sites via git

Here's the situation: there are 9 sites, they all share a similar codebase, but there are differences: Type A: 2 of them could be considered "social" sites (events, news, profiles, login) Type B: 3 of them are your regular sites (events module, news, etc) Type C: 4 of them are small "brochure" type sites (just pages and a contact form)...

Easiest way to persist a data structure to a file in python?

Let's say I have something like this: d = { "abc" : [1, 2, 3], "qwerty" : [4,5,6] } What's the easiest way to progammatically get that into a file that I can load from python later? Can I somehow save it as python source (from within a python script, not manually!), then import it later? Or should I use JSON or something? ...

SetFilePos error Photoshop Format plugin

I'm writting a photoshop plugin. Im currently trying to write code to save my data to file, however any attempt to do so is resulting in SetFilePointer returning -1. What to do!!!! OSErr SetFPos (int32 refNum, short posMode, long posOff) { long moved = SetFilePointer((HANDLE)refNum, posOff, NULL, posMode); if (moved != posOff) ...

Ajax Security Question: JQuery ajax() + PHP scandir() = Security Issue??

I'm a beginner with PHP security issues. Someone reported a security issue with my code, but never gave details. Below is a condensed version of the code. I'm using the JQuery AJAX function to send some data to the server where it's used by the PHP scandir() function. Do you see any security issues? HTML Document <script src="h...

Reading from a file not line-by-line

Assigning a QTextStream to a QFile and reading it line-by-line is easy and works fine, but I wonder if the performance can be inreased by first storing the file in memory and then processing it line-by-line. Using FileMon from sysinternals, I've encountered that the file is read in chunks of 16KB and since the files I've to process are...

How do you take an image (passed in as a Base64 encoded string) and save it to the server in Asp.Net C#?

I want to create a function like this... [AcceptVerbs(HttpVerbs.Post)] public ActionResult SaveImage(string file, string fileName) { } Where the file is the Base64 encoded string created from the image, and the fileName is the name I want to save it as. How can I use this encoded string to write the image to the serve...

Lots of small files or a couple huge ones?

In terms of performance and efficiency, is it better to use lots of small files (by lots I mean as much as a few million) or a couple (ten or so) huge (several gigabyte) files? Let's just say I'm building a database (not entirely true, but all that matters is that it's going to be accessed a LOT). I'm mainly concerned with read performa...

How to find PHPs tmp folder relative to script running?

Hello all, Is it possible to find PHP tmp folder at run time? I am uploading files and I am making use of: $_FILES['upfile']['tmp_name'] However, one of the APIs I am making use of requires that I have to give the full file path of the uploaded file relative to my script! A bit annoying but it has to be done. Any ideas on how I can...

I need to save a String to a text file using Java

I am a beginner Java programmer. I am attempting to make a simple text editor. I have got the text from the text field into a variable that's a String, called "text". My question is, how can I save the contents of the "text" variable to a text file? Thank you! ...

problems with shared project in netbeans

Hi I work with my student group on a project : We have some problems sharing our project. There are 2 files that we have to modify everytime : project.properties private.properties The Problem is, that we use librarys and they are relative paths to our hard drives. so when we check out : we have to modify these files to get the pro...

How to serve files in Drupal without using links?

How do I serve files in Drupal without revealing a link that might be re-used? This sort of thing is usually handled by postbacks in .NET for example, but I can't find any documentation for accomplishing it in Drupal. The goal is to be able to give a specific file to a user exactly once when they complete a series of steps defined by th...

Fast way to enumerate all files including sub-folders

Does anyone know of a faster way to enumerate through a directory and sub-folders to gather all the files in the enumeration? This is what I have right now: Public Shared allFiles() As String allFiles = Directory.GetFiles(<ServerLocation>, "*.*", SearchOption.AllDirectories) Thanks! JFV EDIT: I am enumerating these files from a ser...

What is the best way to write to several logs that are continuously being updated?

Working on an irc client in Adobe AIR in JavaScript, and thinking about logging. Each channel would have its own log file. I wouldn't keep all of the logs open while the app was running would I? I'd log every few minutes? What's the best way to do this? ...