GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   I need a small cgi tweak - txt importing (https://gfy.com/showthread.php?t=440524)

jovigirl 03-06-2005 04:42 AM

I need a small cgi tweak - txt importing
 
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

:thumbsup


All times are GMT -7. The time now is 04:39 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123