CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 File upload issues

Print topic Send  topic

Author Message
kirchaj

Posts: 215
Posted: 05/05/2015, 12:37 PM

I am having a couple issues that may or may not be related with the file upload component.

First, when I don't select a file, I get the appropriate message that the file attachment is required. When I upload a file that is above my file limit size, I don't get the right message. I get a message that looks like it actually tried to insert the record "database error:ERROR: null value in column "crssem_index" violates not-null constraint.

The second part of this issue is that the afterInsert event is firing and sending emails that look like the process completed properly.

The file is not actually on the server and the entry is not actually entered into the database.

Any ideas?
Thanks
TK
View profile  Send private message
kirchaj

Posts: 215
Posted: 05/05/2015, 1:23 PM

I tried recreating the form with no emails and the form still produces the same error message and does not indicate the file is over the filesize limit.

:-/
View profile  Send private message
MichaelMcDonald

Posts: 640
Posted: 05/06/2015, 2:40 AM

Is the file size exceeding php.ini setting?
_________________
Central Coast, NSW, Australia.

View profile  Send private message
kirchaj

Posts: 215
Posted: 05/06/2015, 5:56 AM

No. I just double checked that setting. The php.ini is set to 220mb and my filesize limit in CCS is 150mb.
View profile  Send private message
MichaelMcDonald

Posts: 640
Posted: 05/07/2015, 12:32 AM

Can I assume by no reference to allowable filesize that part is working?
_________________
Central Coast, NSW, Australia.

View profile  Send private message
kirchaj

Posts: 215
Posted: 05/07/2015, 6:16 AM

the disallowed file mask appears to be firing but a similar DB error about a missing key is presented, not a filetype message :|
View profile  Send private message
kirchaj

Posts: 215
Posted: 05/11/2015, 5:41 PM

it appears that all of these problems were caused by a mistyped disallowed file type. one entry was

dll instead of *.dll

everything started working again once I fixed that problem and republished.
View profile  Send private message
kirchaj

Posts: 215
Posted: 05/12/2015, 12:58 PM

ok, I lied. I thought I was crazy this morning but there still seems to be a problem. I tested the app with the following values for file upload size 15000, 150000, 1500000, 15000000. All of these worked fine. When I changed one last time to 150000000 (150mb) the problem reoccurred. I have contacted support for assistance.
View profile  Send private message
kirchaj

Posts: 215
Posted: 05/19/2015, 9:51 AM

The saga continues but I do have more info now. Support has been responsive but not completely "helpful" in solving this issue.

The file upload component works correctly in all situation except one. When the file is over the CCS filesize limit and UNDER the php.ini limit it works correctly. When the file is OVER both the CCS limit and the php.ini limit the upload component does NOT catch the error and proceeds with the insert etc. and causes my database to throw a Null error.

digging back through some old changes to the classes.php file I found this addition

//  *************************************************************************************  
		//  this area added  to remove bad filename characters including  
		//  # $ % ^ & * " " ~ ! @ + { } | : < >   
		//  *************************************************************************************  
		$replace_filename = array("~", "!", "@", "#", "$", "%", "^", "&", "*", "+", " ", "'", "|", "{", "}", ":", "<", ">", "–");  
        while($file_exists) {  
          $ActualFileName = date("YmdHis") . $index . "." . str_replace($replace_filename,"_", $FileName);  
          $file_exists = file_exists($this->FileFolder . $ActualFileName);  
          $index++;  
        }

Think this is causing the problem?

I can't seem to figure this one out. :-/
View profile  Send private message
MichaelMcDonald

Posts: 640
Posted: 05/19/2015, 1:43 PM

Manual file size onvalidate works for files being stored on a server (substitute $filename and $folderpath accordingly) - I have not tested it over ccs and php.ini ... using x 1024 as a MB

if($recordSitedocument->FileUpload1->GetValue() != NULL){
$filename = $recordSitedocument->FileUpload1->GetValue();
$folderpath = './uploadtmp/';
$filepath = $folderpath.$filename;

if(file_exists($filepath)){
$filebytes = filesize($filepath);

if($filebytes > 51200000){
$recordSitedocument->Errors->addError("File exceeds 50MB.");
}


If you are inserting file into database as BLOB and this works can you please advise?
_________________
Central Coast, NSW, Australia.

View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.