How to transfer large file (File size Heap/RAM Size) over the network ?
Lets say I have file (size 10GB) I want to transfer it machine a (RAM 512mb) to machine b
(RAM 512mb).
Want achieve this using java code.
First, is it possible ? Any recommendation on framework. If possible, can we speed this up using threading ? Important criteria: file's data sequence needs to be maintained during transfer. Any example will be great help.
Looking for a way to rename files that are uploaded by users through a filefield. For example, rename user profile photos using uniqid.
I found a good solution for D6 here:
http://www.wesjones.net/home/2011/03/drupal-6-how-to-change-filename-on-upload
but can't find anything for D7.
Another option is to use File (Field) Paths, but (1) the module causes warnings on my setup and (2) seems to be a bit of an overkill to install a general module for a very specific purpose.
can anybody explain why uploaded php files treated by a server as a text file ?
The symptom is when i try to access a php file, the server send me the content of the file.
One of the sites i visit has an annoying habit of naming all their files showimage.php. When i save the image or file it saves as a .php so i cannot open the file. The worse part is, there is a &ext=zip&more=blah in the url.
Is it possible to use greasemonkey to rename the file ext so it isnt php? (maybe injecting a content disposition header?)
I have written
List<Attachment> lstAttachment = new List<Attachment>();
//Check if any error file is present in which case it needs to be send
if (new FileInfo(Path.Combine(errorFolder, errorFileName)).Exists)
{
Attachment unprocessedFile = new Attachment(Path.Combine(errorFolder, errorFileName));
lstAttachment.Add(unprocessedFile);
}
//Check if any processed file is present in which case it needs to be send
if (new FileInfo(Path.Combine(outputFolder, outputFileName)).Exists)
{
Attachment processedFile = new Attachment(Path.Combine(outputFolder, outputFileName));
lstAttachment.Add(processedFile);
}
Working fine and is giving the expected output.
Basically I am attaching the file to the list based on whether the file is present or not.
I am looking for any other elegant solution than the one I have written.
Reason: Want to learn differnt ways of representing the same program.
I am using C#3.0
Thanks.
I'm using FILE type in my MFC project but after compiled, it shows the following errors:
Error 23 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Error 24 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Error 22 error C2146: syntax error : missing ';' before identifier 'm_pFileW'
Those errors are referring to this code:
FILE *m_pFileW;
Did I missing any library header to use FILE syntax? Do I need to use different approach and replace FILE syntax? This errors are only generated when I placed it into my MFC project. This is not happening in C++ Console. Please help.
Thank you.
I am reading one line at a time from a file, but at the end of each line it adds a '\n'.
example:
line is: 094 234 hii
but my input is: 094 234 hii\n
I want to read line by linem but I don't need to keep the newlines...
My goal is to read a list from every line: I need ['094','234','hii'], not ['094','234','hii\n']
Any advice?
Say there is a file called 12345.jpg. In C, how can I get the file extension so that I can compare with some file extension? If there are any inbuilt functions, kindly please let me know.
I have a scenario where i created pipe for communication between two child and parent. Parent writes (using write function)data to the pipe and closes the respective file descriptor. The problem is when i want to write data again to the pipe, the write function is returning error code -1. I think its because writing end has been closed in previous iteration. Then how to open the corresponding file descriptor after it has been closed once.
I tried using open() function which requires path to some file as arguement. But i am not using any files in my application. I have simple file descriptors (int arr[2]).
Is it possible to achieve above scenario with pipes????
Hi All,
I have a text file with Tag - Value format data. I want to parse this file to form a Trie. What will be the best approach?
Sample of File: (String inside "" is a tag and '#' is used to comment the line.)
#Hi, this is a sample file.
"abcd" = 12;
"abcde" = 16;
"http" = 32;
"sip" = 21;
As I know, C inline function body should be defined in .h file
because it causes an error 'function-name used but never defined" if body defined in .c file.
Is this the regular way? Or how to define inline function body in .c file?
I've got this piece of code that I want to write the output to a text file but with the correct format i.e. no brackets, single quotes so it appears as a formatted list.
This is the code:
file = open("env5.txt", "w");
for key in os.environ.keys():
env = os.environ[key];
key1 = key;
list = str([key, env]).replace("'","").replace('[]', '');
list2 = list[1:-1];
print(list2);
file.writelines(list2);
file.close();
This is the original code:
for key in os.environ.keys():
print(key, os.environ[key]);
Many thanks
Hi i am new to blackberry (7.0) environment. Recently i have been trying to download a file from the server on to the sdcard of the simulaotr through a FTP client. After searching a lot, i have not been able to find a reference for how to code a FTP. Can anyone please help or provide me a link where i can get a sample code of how to download a file using FTP. Also when i was working in Android environment previously, i made use of external jar file of FTP. But in Blackberry that same jar file is of no use. So please help me its part of my project...
@echo off
color 0a
title Horror Game
echo.
echo.
echo.
echo.
echo Welcome to the game
echo If you get scared
echo Feel free to leave
echo.
echo.
echo You are in a dark room.
echo It is cold.
echo All you hear is a scratching sound
echo near your feet.
echo What do you do?
echo.
echo.
echo 1.) Feel around you
echo 2.) Listen for anything else
set/p input = Command?
if %input% == "1" goto Feel
if %input% == "2" goto Listen
echo.
echo.
:Feel
echo You feel around and hear a growl.
echo As you realize the scratching was
echo on your leg.
echo.
echo You remember nothing else.
pause
end
I am trying to make a text based game for cmd and whenever i try to enter a response is instantly closes and i can barely read out "goto was unexpected at this time"
how to get the directory name for a particular file on the drive in java?
for example i have a test.java under a test directory on my D drive.how do i find the directory name for this test.java?
I think the number of files is so effective in time of transfering files for example :
Transfering 1000 item that have 1GB size need more time than transfering 1 file with same size.
Hello,
I have a Win7 PC in use as part of an experiment control system. The experiment in question uses 4 windows simultaneously, and I would like to find away to open, position and size these 4 windows with a script.
The script would run at start up, so that the newly booted PC presents the user with the four windows as default.
Obviously I can use a batch file in the startup folder to open windows and run applications, but is there a way to specify the layout of these windows?
Many thanks
Si
Trying to download a file on a remote server and save it to a local subdirectory.
The following code seems to work for small files, < 1MB, but larger files just time out and don't even begin to download.
<?php
$source = "http://someurl.com/afile.zip";
$destination = "/asubfolder/afile.zip";
$data = file_get_contents($source);
$file = fopen($destination, "w+");
fputs($file, $data);
fclose($file);
?>
Any suggestions on how to download larger files without interruption?