Jump to content

sonnieboy

Members
  • Posts

    154
  • Joined

  • Last visited

Everything posted by sonnieboy

  1. Thanks JG. I have this at top of php page: error_reporting(E_ALL); Is that sufficient? I am not even sure it is making it to the processing page because you see the error almost immediately after clicking the Submit button.
  2. I think something else is going on and unfortunately, I have no clue what that is. I have just tried 200M like you suggested and I keep getting This page can’t be displayed This is a web app that allows users to upload files to the server and save the filename along with other fields to the database. Anything less than 20MB has been fine.
  3. Thank you again sir for your help. I have post max size at post_max_size = 1800M Is that too high?
  4. Hi Jacques, Sorry for late response. I wanted to try everything that I could before posting back. When I attempt to upload a file the size of which I indicated above, within 5 seconds, I get: "This Page Cannot be Displayed" error message. This only happens with a large file. When I logged into the error log yesterday, I get the follow: [16-Feb-2016 14:06:20 America/New_York] PHP Notice: Undefined index: NumofBids Today, when I attempt uploading same file, I now get the following error in error log: [17-Feb-2016 12:00:02 America/New_York] PHP Warning: POST Content-Length of 458679 bytes exceeds the limit of 1800 bytes in Unknown on line 0 Frustrated
  5. Thank you for your prompt response, sir but where should I put this? I tried it at the beginning: <?php set_time_limit(0) //no limit but it didn't work. I also tried it at the beginning of the loop: foreach($_POST['delete'] as $file) { set_time_limit(0); $thisfile = __DIR__.'/../uploads/'.$file; ... What am I doing wrong?
  6. Greetings experts, We have an app that allows our users to upload files to the server and save the filename to the database. This has been working great until today when one of our users attempted to upload a file with size of 97MB. Each time she attempted to upload it, the app breaks within 20 seconds. I have increased the file size in ini file but this has not helped. Any ideas how to fix this? Many thanks in advance.
  7. if(isset($_POST["Id"])) { $strId = $_POST["Id"]; //echo $strId; } If ($strId == "") { //echo "This is an insert statement"; // This will generate an insert query $insert = $BidSet->SaveData($_POST) ->SaveFolder('../uploads/') ->AddFiles('BidIDFile') ->AddFiles('item') ->AddFiles('SignInSheet') ->AddFiles('TabSheet') ->AddFiles('Xcontract') ->InsertQuery() ->statement; // Check that statement is not empty if($insert != false) { sqlsrv_query($conn,$insert); ?> <br><br><br><br><br> <div class="error_button"> <div style="float: right; font-size: 18px; font-weight: bold; color: #FFF;" onClick="DisplayErrorTag('close')">x</div> <?php render_error(array("title"=>"Bid Successfully Saved!","body"=>'Go back to <a href="currentrecs.php">Solicitation screen</a>')); ?> </div> <?php $err = false; } //echo '<pre>'; //print_r($insert); // echo '</pre>'; } else { // Check to see if any images need deleting --- --- Hi guys, thanks again for your help. With mac_gyver first, the $strid is coming from the top of the code above. When I echo it, it shows the correct Id. QuickOldCar, neither the database nor any of the tables is corrupt.
  8. Array ( [] => 0 ) // Check to see if any images need deleting if(isset($_POST['delete']) && !empty($_POST['delete'])) { // whilelisted table columns $fileColumnsInTable[] = 'BidIDFile'; $fileColumnsInTable[] = 'TabSheet'; $fileColumnsInTable[] = 'SignInSheet'; $fileColumnsInTable[] = 'XConnect'; $fileColumnsInTable[] = 'Addend1'; $fileColumnsInTable[] = 'Addend2'; $fileColumnsInTable[] = 'Addend3'; $fileColumnsInTable[] = 'Addend4'; $fileColumnsInTable[] = 'Addend5'; $fileColumnsInTable[] = 'Addend6'; // Loop through the post to assign delete fields foreach($_POST['delete'] as $fileCol => $fileColumn) { // If set and allowed to be delete if(in_array($fileCol, $fileColumnsInTable)) { // Save the columns to temp $fileColumns[] = $fileCol; // Save the file spots as blanks in the main post $_POST[$fileCol] = ''; } } // Check that there are files requiring attention if(isset($fileColumns)) { $sql_statement = "select ".implode(", ",$fileColumns)." from bids where ID = ?"; $query = sqlsrv_query($conn,$sql_statement,array($strId)); // No files, just return if($query === false) return $errors = 'file_fail_link'; $files = sqlsrv_fetch_array($query, SQLSRV_FETCH_ASSOC); print_r($files); I am really confused now. How did this work before? When I run above code and do print_r($files); I get this: Array ( [] => 0 ) How did this work before? What changed?
  9. Why is the result looking like this? E:\inetpub\wwwroot\Train\Boards/uploads/0 Notice the 0?
  10. Great suggestion, iarp!! This is what it shows: E:\inetpub\wwwroot\Train\Boards\admin/uploads/0 The path should actually be: E:\inetpub\wwwroot\Train\Boards/uploads/ And the issue is here: $thisfile = __DIR__.'/uploads/'.$file; How do I change this to correspond with E:\inetpub\wwwroot\Train\Boards/uploads/ Thank you
  11. First of all, thanks for the prompt response. That was my initial thought but I check file permissions and that was not the problem. Besides, we could save files to the folder. It is just that we are no longer able to unlink any files.
  12. // Check to see if any images need deleting if(isset($_POST['delete']) && !empty($_POST['delete'])) { // whilelisted table columns $fileColumnsInTable[] = 'BidIDFile'; $fileColumnsInTable[] = 'TabSheet'; $fileColumnsInTable[] = 'SignInSheet'; $fileColumnsInTable[] = 'XConnect'; $fileColumnsInTable[] = 'Addend1'; $fileColumnsInTable[] = 'Addend2'; $fileColumnsInTable[] = 'Addend3'; $fileColumnsInTable[] = 'Addend4'; $fileColumnsInTable[] = 'Addend5'; $fileColumnsInTable[] = 'Addend6'; // Loop through the post to assign delete fields foreach($_POST['delete'] as $fileCol => $fileColumn) { // If set and allowed to be delete if(in_array($fileCol, $fileColumnsInTable)) { // Save the columns to temp $fileColumns[] = $fileCol; // Save the file spots as blanks in the main post $_POST[$fileCol] = ''; } } // Check that there are files requiring attention if(isset($fileColumns)) { $sql_statement = "select ".implode(", ",$fileColumns)." from bids where ID = ?"; $query = sqlsrv_query($conn,$sql_statement,array($strId)); // No files, just return if($query === false) return $errors = 'file_fail_link'; $files = sqlsrv_fetch_array($query, SQLSRV_FETCH_ASSOC); //print_r($files); // loop over the files returned by the query foreach ($files as $file) { $thisfile = __DIR__.'/uploads/'.$file; //delete file if(is_file($thisfile)) unlink($thisfile); } } } if(isset($_POST['delete'])) unset($_POST['delete']); { //echo "This is an update statement"; // This will generate an update query $update = $BidSet->SaveData($_POST,array("Id")) ->SaveFolder('../uploads/') ->AddFiles('BidIDFile') ->AddFiles('item') ->AddFiles('SignInSheet') ->AddFiles('TabSheet') ->AddFiles('Xcontract') ->where(array("Id"=>$_POST["Id"])) ->UpdateQuery() ->statement; //echo '<pre>'; //print_r($update); //echo '</pre>'; //***************************************************************************************************** <td> <table border="0"> <tr> <td class="td_input_form"> <?php // if the BidIDFile is empty, if(empty($result["BidIDFile"])) { //then show file upload field for Bid File echo '<input type="file" name="BidIDFile[]" size="50">'; } else { // Bid file already upload, show checkbox to delete it. echo '<input type="file" name="BidIDFile[]" size="50"> <br />'; echo '<input type="checkbox" name="delete[]" value="'.$result["BidIDFile"].'"> (delete) <a href="http://KitApps/train/Boards/uploads/'.$result["BidIDFile"].'" target="_blank" onclick="window.open (this.href, \'child\', \'height=800,width=850,scrollbars\'); return false" type="application/octet-stream">'.$result["BidIDFile"].'</a>'; } ?> </td> </tr> </table> </td> Dear all, I have some code snippets. Complete code is very long. The code does insert and update. You can unlink (delete) a file only without updating any records or you unlink a file as well as update records. This has worked very well before but suddenly, it is no longer unlinking a file but record updates still work fine. Any ideas why? Please see code snippet. Thanks a lot in advance.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.