file

file upload cakephp

when uploading an image to the server using cakephp $this->Model->Behaviors->attach('ImageUpload', Configure::read('photo.files')); photo uploaded successfully, and the database fields also but shows following error instead of returning to index page. Notice (8): Undefined index: class [CORE\cake\libs\model\behaviors\upload.php, l...

Is File.Delete() atomic under .NET

Target OS: Win2003 As posted in other SO questions about file operation atomicity, Win32 was simply not designed for transactions. Still I wonder whether file deletion could be non-atomic. After all, it is either get deleted or not. Or can a file remain in any other intermediate state on NTFS file system caused by a system crash or som...

C#/.Net: Returning a file to the browser?

Following this question it was recommend that I should create a server side file that can return a file from the file system. How would I go about doing this in c# and .net. I imagine I pass the filename as a query string, this is read by the page and the file returned. Not really sure where to start on this from a codding point. ...

WCF Security Exception caused by Directory.Delete()

Hi, I am encountering a strange issue: I call a WCF-Operation from my client. The operation deletes all files in a specified directory and finally deletes their parent directory too. ACtually, this works. No exception is thrown and the files within the folder and the folder itself are deleted successfully. But: the wcf context of my c...

uploading a file on mac os x using adobe flex 3

Hi, I've created a fileUpload.mxml component in flex 3 which basically uploads m4a's to a designated server. The general code is below: private var uploadURL:URLRequest; private var file:FileReference; file=new FileReference(); file.browse(getTypes()); var params:URLVariables = new URLVariables(); params.fileID = model.selectedFileUp...

how to handle multiple file upload using PHP

hello i want to upload files using PHP but the problem is that i don't know how many files i will upload, my question is how can i upload files if i use file[] ? <form action="upload.php" method="post" enctype="multipart/form-data"> <label for="file">Filename:</label><input type="file" name="file[]" id="file" /> <br /> <label for="fil...

C programming pointer arrays read file

The line *array[cnt] = thing causes a seg fault and I don't know why. Any ideas to fix this? long *Load_File(char *Filename, int *Size) { FILE *fp; if((fp = fopen(Filename,"r")) == NULL) { printf("Cannot open file.\n"); exit(-1); } fscanf(fp,"%d",Size); int cnt = 0; int items = *Size; l...

How to disable error message in file dialog?

Suppose I have a Win32 C++ application that displays a save file dialog. Also suppose that I browse to C:\Windows (or some other protected location) and type a file name. Then suppose I hit save. What happens is I get a message saying I don't have permission to save there and would I like to save to My Documents instead. So here is the ...

File remains locked even after calling filestream.close

Hi, In my application, i am downloading file from DMS system to my server. Once the file gets downloaded, on some environment, the iis keeps lock of the file and when the application tries to redownload the file and put the file on same location, an error is generated that file is being used by another process. Following is the code : ...

How to disable error message in file dialog?

Suppose I have a Win32 C++ application that displays a save file dialog. Also suppose that I browse to C:\Windows (or some other protected location) and type a file name. Then suppose I hit save. What happens is I get a message saying I don't have permission to save there and would I like to save to My Documents instead. So here is the ...

how to make a queue from data in a file

here is what i have so far. the problem i am faceing is how do i find the number of elemets in the file so i can initialze the queue. Your suggestions will b most appritated. class FileHandler { BufferedReader data; DataInputStream in; public FileHandler(String fileName) { try { data = new BufferedReader(new FileReader(...

Script output to file when using SQL-Developer

I have a select query producing a big output and I want to execute it in sqldeveloper, and get all the results into a file. Sql-developer does not allow a result bigger than 5000 lines, and I have 100 000 lines to fetch... I know i could use SQL+, but let's assume I want to do this in sqldeveloper. ...

How can I Compress a directory with .NET?

I have a directory that contains several files. I want compress this folder to a zip or tar.gz file. How can I do his work in C#? ...

Reading and Writing Configuration Files

Hello everybody! I'm writing a small script which generates some configuration for devices. I want to have separate file, where I'm storing configuration, and change some strings during printing the content of the configuration to the browser. How can I replace string in a line of the file with a variable from $_POST['somevariable']? --...

Pick video file from iPhone local library

Hi, I know how to pick audio file (MPMediaPickerController), but how to pick video file??? thanks ...

Download file from webservice - in ASP.NET site

I want to push a file to the browser from a website using a webservice. I'm currently reading the file into a base64 byte array, and returning that from the webservice. This webservice is called from a website, and i'm stuck on how to push this as the original file to the browser. Ideally I would like to read the byte array into a memo...

Generate jSon file

How to generate jSon file via PHP? I have seen jSon files over 4mb and more. I think tt's very good practice to keep such big data cached than taken from database everytime. And update it one a week or a day. Thanks ...

Undeletable file due to backup script

I just wrote this backup script: #!/usr/bin/bash # the number of days to do the backup for. days=5; # the files to backup. location[0]='/opt/aDirectory/' location[1]='/extra/anotherDirectory/' # the location to copy the file to copyLocation='/users/JoeBlow/Backup/backup-'$(date | tr ' ' '-') # Log stuff mkdir $copyLocation echo "mad...

Ant + Keeping a control value.

Hi, I need to keep a control value (possibly inside a file), in order to decide whether to execute a task or not. I'm coming from here: http://stackoverflow.com/questions/2239236/ant-how-can-i-subtract-two-properties-containing-timestamps What I want to do, is to check if the control value is equal to a period (mmYY). If it is equal, ...

PHP limited by filesize saving a blob in oracle

Hi, I'm using a php script to save a binary stored in the server's temp directory into oracle as a blob. It works fine for filesizes < 7MB, any larger than that and it just doesn't save. The php post and file upload limit is 32MB. The script stops completely at lob->savefile($tempFile). The general code is below: $stid = oci_parse($con...