files

Sharing storage between servers

I have a PHP based web application which is currently only using one webserver but will shortly be scaling up to another. In most regards this is pretty straightforward, but the application also stores a lot of files on the filesystem. It seems that there are many approaches to sharing the files between the two servers, from the very s...

Absolute file path to relative URL - c#

I've seen lots of tutorials on resolving a relative url to an absolute path, but i want to do the opposite: resolve an system absolute filepath into a relative url. Is there a nice hack-free way to turn a filepath like c:\my_website_root\images\picture_a.jpg into images/picture_a.jpg I've had a look at Uri.MakeRelative() but i dont thi...

mercurial .hgignore - won't ignore files...

Hi - I'm trying to ignore a file in my project with .hgignore, and just can't figure it out. The file is located in app/views/patterns/_changes.erb (relative to the root of the project, where .hgignore is), and nothing I try seem to work: #.hgignore syntax: glob app/views/patterns/_changes.erb *changes.erb public/files/* # this works ...

For loop only inserts one filename

for($i = 0; $i < $uploadsNeeded; $i++){ $file_name = $_FILES['uploadFile'. $i]['name']; $file_name = stripslashes($file_name); $file_name = str_replace("'","",$file_name); $uploaddir = "media/files/".$_FILES['uploadFile'. $i]['name']; $copy = move_uploaded_file($_FILES['uploadFile'. $i]['tmp_name'], $uploaddir); if($copy){ ...

.htaccess deny access to specific files? more than one

I am able to disable access to a file with .htaccess, but I don't know how to disallow multiple files to be viewed (directly, not from includes) They are .php so I can't disable a file type (like the only tutorials online say..) <FILES ... ? </FILES> Or something.. For example "home.php, file.php , test.php" how do I disallow acces...

How to set the modification time of a file programmatically?

How do I set the modification time of a file programmatically? OS: Windows Programming Language: C ...

Uploading multiple files simultaneously with Flex

I have been working on a flex uploader, where the user can select multiple files. It works fine when the files are uploaded in a queue (one at a time), however as soon as I try to have it upload 2 files at once I run into issues. It seems that files will often lock up, and either stay at 1% until every other file is uploaded, or just n...

Bash: Copy a folder full of files and folders to an external hdd, but only if there is enough space to complete the copy.

I want to copy a folder from my X-Serve RAID to an external HDD on an X-Serve. Both disks are on the same server, so copying is fairly easy. I use the ditto command: ditto -rsrc /Volumes/WadXServeRaid/Users/ $destinationpath/Users/ However, I only want the copy to start if there is enough space on the destination disk. I know I can us...

How to send actions to targets other than File's Owner?

Hi, Newbie here, I am trying to send actions from button touches to a controller other than the one acting as File's Owner. I have four distinct areas of the screen that I would like managed by four separate controllers (buttonController, toolbarController, textController and graphicController) with a fifth controller (mainController) co...

Apache/PHP serving file multiple times

I have a system with a download.php page. The page takes and id and loads a file based on from the DB Record and then serves it up. I've noticed a couple instances where files are requested multiple times in short time spans (20ms). Times that are too quick for human input. There are plenty of instances where the downloader functions fin...

How to hide using C\C++ with Show hidden Files and Folder enabled

I would like to know how to programmatically hide a file but making the file or folder still hidden with Show hidden files and folders enabled from the Tools->Folder options of Explorer. I hope I am not confusing anyone and if I might be please just ask. ...

command_line argument

I can not get the difference between these sentences! would you please write some snippet code for these sentences?thanks The program will receive a path to a directory as the first command-line argument. The program will receive a path to a file as the second command-line argument. ...

Download Files within iPhone app

Hi, I am currently developing an iPhone app and would like to implement the ability to download files (specifically pdf, mp3, doc and ppt files) from the internet. I have created the UIWebView, but want to know the best way of capturing the files when they are linked to in the webview and then download them to a specified folder in the ...

Scala script to copy files

I want to copy file a.txt to newDir/ from within a scala script. In java this would be done by creating 2 file streams for the 2 files, reading into buffer from a.txt and writing it to the FileOutputStream of the new file. Is there a better way to achieve this in scala? May be something in scala.tools.nsc.io._. I searched around but co...

Why is File.Exists() much slower when the file does not exist?

Seems to me that File.Exists() is much slower when the file does not exist or the use doesn't have access than when the file does exist? This doesn't make sense to me. ...

Gridview bound to filenames in directory

Hi, I'm having some evils trying to get my GridView control to behave. I have the below code, which successfully displays all the files in the directory. However I require two changes, both of which I am struggling with: a) Currently the URL you get when clicking on the URL field is http://localhost/LBSExplorer/SharedUser.csv (ie my h...

I currently use SVN with Linux. How do I add files from my Windows Desktop?

You know, the regular "svn commit". "svn up." When I did svn co, it was linked with SSH. svn co +ssh or something. How would I link this with Windows? I'm using Windows and I'd like to put some code i this SVN. What tools do I use to get started? Can I checkout normally, with the Linux syntax? ...

Why does FileCopy fail at random on Windows 7?

I have a VB6 program running on Windows 7. It is copying a large number of files and sometimes FileCopy fails with an access violation (between every 60 and 500 files). I cannot reproduce it using a single file, only during such mass-copying operations this problem happens. It makes no difference, if source/target are on hard disks, n...

Can a recursive function write to a file in C++?

I'm going to have two class functions. The first class function opens the file. Then it calls a second function that writes to the file and recursively calls itself. When the second function finishes, the original function closes the file. Is it possible to do this? ...

Saving the audio file in documents directory.

Hello friends, I am developing a application where i have to save the audio file and later mail it. Can you give me some idea regarding this like the format in which it should be saved so that it can be played later anytime and also mailed. So please let me know the step wise process or any sample code would be helpful. Thanks in advanc...