Search Results

Search found 72370 results on 2895 pages for 'file moving'.

Page 51/2895 | < Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >

  • Java Save Object to File

    - by Kristian Matthews
    I've tried implementing various methods from around the internet, all seem to be providing the same solution. But it just won't work and I'm unsure why, it creates the file, however, it's blank and if I try loading that file, it has an error. Main.java contains the code to save and load the file: 190-224. Rooms.java contains the object. Code Any help is greatly appreciated, I've been trying for almost a week now! Thanks in advanced!

    Read the article

  • Unzip .zip file uploaded from Android via PHP to IIS 7

    - by HaOx
    I'm sending compressed file in .zip extension from Android via PHP to IIS server. Almost is working everything, but I cannot achieve unzip files with php. I've this code: <?php $target_path1 = "C:/Windows/Temp/"; $target_path1 = $target_path1 . basename( $_FILES['uploaded_file']['name']); /* I'm making the folder */ $directorio = substr($target_path1, 0, 32); if (!is_dir($directorio)) { mkdir($directorio); } /* I declare a path */ $barra = "/"; $target_path1 = $directorio . $barra . basename( $_FILES['uploaded_file']['name']); $target_path2 = $directorio . $barra; if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $target_path1)) { /* Here I want to unzip the uploaded file */ } else{ echo "There was an error uploading the file, please try again!"; echo "filename: " . basename( $_FILES['uploaded_file']['name']); echo "target_path: " .$target_path1; } ?> So, how can I unzip uploaded file? I tried so many methods but no one worked. I'd be appreciated if someone could tell what I have to do to unzip the uploaded file. And if I have to configure some parameters in php.ini or IIS server. Thanks in advance.

    Read the article

  • What is the best file format to parse?

    - by anxiety
    Scenario: I'm working on a rails app that will take data entry in the form of uploaded text-based files. I need to parse these files before importing the data. I can choose the file type uploaded to the app; the software used by those uploading has several export options regarding file type. While it may be insignificant, I was wondering if there is a specific file type that is most efficiently parsed. This question can be viewed as language-independent, I believe. (While XML is commonly parsed, it is not a feasible file type for sake of this project.)

    Read the article

  • RAKE won'tt create xml file

    - by user296507
    hi, i'm a bit lost here as to why my RAKE task will not create the desired XML file, however it works fine when i have the method 'build_xml' in the .RB file. require 'rubygems' require 'nokogiri' require 'open-uri' namespace :xml do desc "xml build test" task :xml_build => :environment do build_xml end end def build_xml #build xml docoument builder = Nokogiri::XML::Builder.new do |xml| xml.root { xml.location { xml.value "test" } } end File.open("test.xml", 'w') {|f| f.write(builder.to_xml) } end

    Read the article

  • Read txt file using Javascript

    - by piemesons
    I am taking a text file from user and then posting that file back to the browser using ajax storing the content in db and then showing the content back to user page using Jquery post response. Now i want to something like this.. Read the text file from the user computer using javascript. Display the content and when he submits the page I will save the values.

    Read the article

  • parsing urls from windows batch file

    - by modest
    I have a text file (myurls.txt) whose contents are a list of URLs as follow: Slides_1: http://linux.koolsolutions.com/svn/ProjectA/tags/REL-1.0 Exercise_1: http://linux.koolsolutions.com/svn/ProjectA/tags/REL-1.0 Slides_2: http://linux.koolsolutions.com/svn/oldproject/ProjectB/tags/REL-2.0 Exercise_2: http://linux.koolsolutions.com/svn/ProjectB/tags/REL-1.0 Exercise_3: http://linux.koolsolutions.com/svn/BlueBook/ProjectA/tags/REL-1.0 Now I want to parse this text file in a for loop such that after each iteration (for e.g. take the first url from the above file) I have the following information into different variables: %i% = REL-1.0 %j% = http://linux.koolsolutions.com/svn/ProjectA %k% = http://linux.koolsolutions.com/svn/ProjectA/tags/REL-1.0 After some experiment I have the following code but it only works (kind of) if the URLs have same number of slashes: @echo off set FILE=myurls.txt FOR /F "tokens=2-9 delims=/ " %%i in (%FILE%) do ( @REM <do something with variables i, j and k.> ) I am fine with other solutions like for e.g. using Windows Script Host/VBS script as long as it can run with a default Windows XP/7 installation. In other words, I know I can use awk, grep, sed, python, etc. for Windows and get the job done but I don't want the users to have to install anything besides a standard windows installation.

    Read the article

  • I want to know when a file is down downloading

    - by paulj3000
    Hi, I have a file which I want users to download only once. After it's done downloading, the file is no longer available. Outside of setting up a streaming system, is there any way I can set some sort of callback up to say the file is done downloading on the client's computer? Thanks

    Read the article

  • php - efficent way to get and remove first line in file

    - by Marco Demaio
    Hello, I have a script that each time is called gets the 1st line of a file. Each line is known to be exactly of the same length (32 alphanumerci chars) and terminates with a "\r\n". After getting the 1st line, the script removes it. Now I do in this way: $contents = file_get_contents($file)); $first_line = substr($contents, 0, 32); file_put_contents($file, substr($contents, 32 + 2)); //+2 because we remove also the \r\n Obvioulsy it works, but I was wondering if there could be a smarter (or more efficent) way to do this??? In my simple solution I basically read and rewrite all the file just to take and remove the 1st line. Thanks!

    Read the article

  • Need to copy remotely hosted file via Shell Command

    - by pnm123
    There is a file that hosted remotely on a server that is not supporting Shell Access. I bought a new server that supports Shell Access so now I want to copy a file that is on the non-supporting server to new server via a Shell Command using Putty. File url is like this http://www.domain.com/file.gzip and it is username/password protected. To be more specific, I want to copy a backup of a home directory from cPanel to my new server via Shell command. I have done this few months ago but I don't remember it now and also I failed to Google it.

    Read the article

  • Uploading File Problem in PHP on Drupal

    - by Nitz
    I don't know why but i had written clear cut code for uploading file in my page. i had written like this... on the client side. <form id="recipeform" onsubmit="return checkAll()" action="submit.php" method="post" class="niceform" enctype="multipart/form-data"> <input name="uploaded" type="file" /> And on submit.php... i am writting like this..... $target = "newupload/"; $target = $target . basename( $_FILES['uploaded']['name']) ; $ok=1; if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)){ echo "The file ". basename( $_FILES['uploaded']['name']). " has been uploaded"; } else{ echo "Sorry, there was a problem uploading your file."; } simple code but then also i can't able to upload the file.. And i had made my webiste in Drupal. Thanks in advance. www.panchjanyacorp.com

    Read the article

  • Most Efficient Way to Write to Fixed Width File (Ruby)

    - by Ruby Novice
    I'm currently working with extremely large fixed width files, sometimes well over a million lines. I have written a method that can write over the files based on a set of parameters, but I think there has to be a more efficient way to accomplish this. The current code I'm using is: def self.writefiles(file_name, positions, update_value) @file_name = file_name @positions = positions.to_i @update_value = update_value line_number = 0 @file_contents = File.open(@file_name, 'r').readlines while line_number < @file_contents.length @read_file_contents = @file_contents[line_number] @read_file_contents[@positions] = @update_value @file_contents[line_number] = @read_file_contents line_number += 1 end write_over_file = File.new(@file_name, 'w') line_number = 0 while line_number < @file_contents.length write_over_file.write @file_contents[line_number] line_number += 1 end write_over_file.close end For example, if position 25 in the file indicated that it is an original file the value would be set to "O" and if I wanted to replace that value I would use ClassName.writefiles(filename, 140, "X") to change this position on each line. Any help on making this method more efficient would be greatly appreciated! Thanks

    Read the article

  • File upload-download in its actual format.

    - by ras
    hi, I've to make a code to upload/download a file on remote machine. But when i upload the file new line is not saved as well as it automatically inserts some binary characters. Also I'm not able to save the file in its actual format, I've to save it as "filename.ser". I'm using serialization-deserialization concept of java. Thanks in advance.

    Read the article

  • SHFileOperation replace file dialog

    - by JHowzer
    Currently, SHFileOperation has some confirm file replacement dialog boxes that ask the user if they would like to replace a file or not. I find these useful, but I would like to be able to modify the scenario in which they occur. Instead, I would like to compare the file contents first with a bool compareFile() function I wrote. Then, if the files are identical the file replacement dialog box will not come up. Assuming, I already have a working compareFile() function, is there a way for me to do this? Thank you for your time.

    Read the article

  • Reading a large text file to memory in C++

    - by NoneType
    Is there a way to read a large text file (~60MB) into memory at once (like a compiler flag to increase program memory limit) ? Currently, ofstream's open function throws a segmentation fault while trying to read this file. ifstream fis; fis.open("my_large_file.txt"); // Segfaults here The file just consists of rows of the form number_1<tabspace>number_2 i.e., two numbers separated by a tabspace.

    Read the article

  • Batch file to perform a looped search based on the line items of a text file.

    - by Tulga
    I have been reading great posts in this forum and got close to what I want to do but couldn't figure out the exact code. I want to create a windows batch file to do following: Perform a looped search for each line item of a text file (this is a list of keyword) to locate files in a a specific directory For this search partial match is okay. Each time a file is found, move it to a predefined directory (e.g. C:\temp\search_results) Thanks.

    Read the article

  • How to Generate the .Form file using .java file in swings

    - by vamshikpd
    Hi all, I am using SunJavaStudio Enterprise 8 and Swing frame work In swing, In My source folder, I have Demo.java and Demo.form file. Demo.form file is the Design file. If both files in the Source folder,java file shows source and design view in IDE. If I delete the Demo.form in source folder,The Design view doesn't show. I have only Demo.java file,How can i generate the Demo.form ? please can u help me urgent

    Read the article

  • Python text file processing speed issues

    - by Anonymouslemming
    Hi all, I'm having a problem with processing a largeish file in Python. All I'm doing is f = gzip.open(pathToLog, 'r') for line in f: counter = counter + 1 if (counter % 1000000 == 0): print counter f.close This takes around 10m25s just to open the file, read the lines and increment this counter. In perl, dealing with the same file and doing quite a bit more (some regular expression stuff), the whole process takes around 1m17s. Perl Code: open(LOG, "/bin/zcat $logfile |") or die "Cannot read $logfile: $!\n"; while (<LOG>) { if (m/.*\[svc-\w+\].*login result: Successful\.$/) { $_ =~ s/some regex here/$1,$2,$3,$4/; push @an_array, $_ } } close LOG; Can anyone advise what I can do to make the Python solution run at a similar speed to the Perl solution? I've tried just uncompressing the file and dealing with it using open instead of gzip.open, but that made a very small difference to the overall time.

    Read the article

  • File mode for creating+reading+appending+binary

    - by MihaiD
    I need to open a file for reading and writing. If the file is not found, it should be created. It should also be treated as a binary for Windows. Can you tell me the file mode sequence I need to use for this? I tried 'r+ab' but that doesn't create the files if they are not found. Thanks

    Read the article

  • Detecting file upload size on the client side?

    - by DisgruntledGoat
    I'm using PHP for file uploads. In the PHP manual it shows an example using a MAX_FILE_SIZE hidden field, saying that it will detect on the client side (i.e. the browser) whether the file is too large or not. I've just tried the example in Firefox, Chrome and IE and it doesn't work. The file is always uploaded, even if it is way larger than the specified hidden field. Incidentally, if the file is larger than MAX_FILE_SIZE then calling move_uploaded_file doesn't work, so it seems the variable is having an effect server-side, but not client-side.

    Read the article

  • The ultimate c# file and directory utility library?

    - by Serge van den Oever
    I find myself writing file and directory utility functions all the time, and I was wondering if there is good file and directory library that already implements a more extensive set than available by default in System.IO. The kind of functions I'm looking for is things like: public static void GetTemporaryDirectory() { string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); Directory.CreateDirectory(tempDirectory); return tempDirectory; } public static void CreateEmptyFile(string filename) { File.Create(filename).Dispose(); } public static void CreateEmptyFile(string path, string filename) { File.Create(Path.Combine(path, filename)).Dispose(); } public static void CreateDirectory(string path) { Directory.CreateDirectory(path); } public static void CreateDirectory(string path, string childpath) { Directory.CreateDirectory(Path.Combine(path, childpath)); }

    Read the article

  • Splitting a file before upload?

    - by Yevgeniy Brikman
    On a webpage, is it possible to split large files into chunks before the file is uploaded to the server? For example, split a 10MB file into 1MB chunks, and upload one chunk at a time while showing a progress bar? It sounds like JavaScript doesn't have any file manipulation abilities, but what about Flash and Java applets? This would need to work in IE6+, Firefox and Chrome. Update: forgot to mention that (a) we are using Grails and (b) this needs to run over https.

    Read the article

  • local file access with javascript

    - by Jared
    is there any local file manipulation that's been done with javascript? i'm looking for a solution that can be accomplished with no install footprint like requiring AIR. specifically, i'd like to read the contents from a file and write those contents to another file. at this point i'm not worried about gaining permissions, just assuming i already have full permissions to these files.

    Read the article

  • Problem with reading and writing to binary file in C++

    - by Reem
    I need to make a file that contains "name" which is a string -array of char- and "data" which is array of bytes -array of char in C++- but the first problem I faced is how to separate the "name" from the "data"? newline character could work in this case (assuming that I don't have "\n" in the name) but I could have special characters in the "data" part so there's no way to know when it ends so I'm putting an int value in the file before the data which has the size of the "data"! I tried to do this with code as follow: if((fp = fopen("file.bin","wb")) == NULL) { return false; } char buffer[] = "first data\n"; fwrite( buffer ,1,sizeof(buffer),fp ); int number[1]; number[0]=10; fwrite( number ,1,1, fp ); char data[] = "1234567890"; fwrite( data , 1, number[0], fp ); fclose(fp); but I didn't know if the "int" part was right, so I tried many other codes including this one: char buffer[] = "first data\n"; fwrite( buffer ,1,sizeof(buffer),fp ); int size=10; fwrite( &size ,sizeof size,1, fp ); char data[] = "1234567890"; fwrite( data , 1, number[0], fp ); I see 4 "NULL" characters in the file when I open it instead of seeing an integer. Is that normal? The other problem I'm facing is reading that again from the file! The code I tried to read didn't work at all :( I tried it with "fread" but I'm not sure if I should use "fseek" with it or it just read the other character after it. Forgive me but I'm a beginner :(

    Read the article

  • Create unique file name and fetching it to commandline argument

    - by user343934
    Hi everyone, I am working on python right now and i am little bit stuck in performing some tricks. I have web form with two options- File upload and textarea, i can easily pass file name with file upload options but have problem when it's textarea. Because when i use textarea then first i have to save values passed from textarea to some files and save it on the working directory. After that i can execute commandline argument and pass same saved filename name. For this problem i have to generate unique file first and save the values passed from textarea in it. Can anybody give me some tips to solve my problem. Any algorithms, suggestions and lines of code are appreciated. Thanks for your concern

    Read the article

< Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >