Basically I have a script that allows me to import data pasting it directly into the browser window or uploading a file thru the browser.
Problem is files are too big and the browser times out.
So I would like to upload the file via ftp and make the script read the file directly from the server.
How can I add an else option that checks if a file located at /path/new.txt exists ?
The code I am using right now is like this:
if(SCRIPT::App::Guts::strip($q->param("new_data")) ne ""){
$new_data= $q->param("new_data");
}else{
if($data_file){
my $new_file = file_upload('new_data_file');
open(UPLOADED, "$new_file") or die $!;
{
local $/ = undef;
$new_data= <UPLOADED>;
}
close(UPLOADED);
unlink($new_file) or warn "could not remove uploaded data, '$new_file': $!";
}
}
Thanks
