file

php - feof error

The file that I'm trying to read is a pgp-encrypted file. This is part of the process to decrypt it and I'm actually attempting to read the contents into a string so that I can then decrypt it. I'm not sure if that's the core problem here or not, but I'm getting an error: Warning: feof(): supplied argument is not a valid stream resou...

How to detect page redirect with PHP?

I'm trying to detect whether an image exists on a remote server. However, I've tried several methods and can't get any of them to work. Right now I'm trying to use this: if (!CheckImageExists("http://img2.netcarshow.com/ABT-Audi_R8_2008_1024x768_wallpaper_01.jpg")) { print_r("DOES NOT EXIST"); } else { print_r("DOES EXIST"); }...

Java - Reading a csv file line by line - stuck with weird non-existent characters being read!

hello fellow java developers. I'm having a very strange issue. I'm trying to read a csv file line by line. Im at the point where Im just testing out the reading of the lines. ONly each time that I read a line, the line contains square characters between each character of text. I even saved the file as a txt file in wordpad and not...

Batch file command line arguments

I want to pass a command as a command line argument from one batch file to another e.g. first.bat call test.bat "echo hello world" "echo welcome " test.bat set initialcommand=%1 set maincommand=%2 %maincommand% %initialcommand% ...

Need to get the uploaded file to my local PC

Hi, I have created a test form which will ask users to enter a name and upload the image file: <html lang="en"> <head> <title>Testing image upload</title> </head> <body> <form action="/services/upload" method="POST" enctype="multipart/form-data"> File Description: <input name='fdesc' type='text'><br> File name: <input ty...

Sending big file by webservice and OOM exception

Hi, I have webservice, with method: [WebMethod] public byte[] GetFile(string FName) { System.IO.FileStream fs1 = null; fs1 = System.IO.File.Open(FName, FileMode.Open, FileAccess.Read); byte[] b1 = new byte[fs1.Length]; fs1.Read(b1, 0, (int)fs1.Length); fs1.Close(); return b1; } and it works with ...

MySQL Config File for Large System

We are running MySQL on a Windows 2003 Server Enterpise Edition box. MySQL is about the only program running on the box. We have approx. 8 slaves replicated to it, but my understanding is that having multiple slaves connecting to the same master does not significantly slow down performance, if at all. The master server has 16G RAM, 10...

loading Data in VBA from a text file

I am not very familiar with VBA but need to use it for a new software program I am using (not Microsoft related) I have a text file that has columns of data I would like to read into VBA. Specifically the text file has 4 entries per row. Thus I would like to load in the column vectors (N by 1). The text file is separated by a space be...

Conditionaly strip the last line from a text file

Hello, I posted this yesterday on SO, and I received an answer that works great, but I need to change it around and I don't know how. Here is my original question: I need to strip the last line from a text file. I know how to open and save text files in C#, but how would I strip the last line of the text file? The text file will al...

How to save a string into file in applicationdirectory and get its real location? (Adobe Air)

How to save a string into file (file.superlongextention) in applicationdirectory and get its real locationon Hard drive (like C:/files/...)? ...

Doubt about Scripting.file

How do I create a instance of Scripting.file from a file path? I tried a lot with C# in Visual Studio, but don't know how do. ...

How to stop process from .BAT file?

So I have process I started from one bat file. How to stop it from another? ...

How to programmatically cut/copy/get files to/from Windows clipboard in a systam standard compliand form?

How to put a cut/copy reference to specific files and/or folders into Windows clipboard so that when I open standard Windows Explorer window, go to somewhere and press Ctrl+V - the files are pasted? If I copy or cut some files/folders in Windows Explorer, how do I get this info (full names and whether they were cut or copied) in my Prog...

Transfer files in using c#

how can I copy files from folder to another when by using c#? ...

How do I use File.new to find a file from Rails?

I am trying to read a file that has been saved on the /system folder using Paperclip, for example. But when I use that .url method from Paperclip to read that file using File.new, I get that the file isn't found. The directory is correct, but I still can't access it. What is the right way to find a file for File.new for example? I tr...

Using file() incrementally?

I'm not sure if this is possible, I've been googling for a solution... But, essentially, I have a very large file, the lines of which I want to store in an array. Thus, I'm using file(), but is there a way to do that in batches? So that every,say, 100 lines it creates, it "pauses"? I think there's likely to be something I can do wi...

File viewer with sliding buffer

Hello, I'd like to make a simple text file viewer and I'd like it to be able to handle large files (possibly larger than the computer's memory). I know that I need to implement something like a sliding buffer, that will contain the currently visible portion of the file. The main problem is to determine the relation between lines and fil...

Generating TrueType file: Why always invalid?

Hello everbody, as said above, I wrote a little Python script that reads WOFF files (my own free fonts), extracts the embedded TrueType font data tables and rewrites them into TrueType font files. Well, it should theoretically. :-) I read the specs (WOFF -- TrueType) and did everything as stated there. Here I posted a short overview of...

Strategy for handling user input as files

I'm creating a script to process files provided to us by our users. Everything happens within the same UNIX system (running on Solaris 10) Right now our design is this User places file into upload directory Script placed on cron to run every 10 minutes. Script looks for files in upload directory, processes them, deletes immediately af...

I have this broken php upload script

I have this script for uploading a image and content from a form, it works in one project but not the other. I have spent a good few hours trying to debug it, I am hoping someone could point out the issue I might be having. Where there are comments is where I have tried to debug. The first error I got was the "echo invalid file" at the b...