php - 502 Bad Gateway Error, when attempting to upload files to Wordpress -
i having difficult time figuring out why cannot upload files wordpress uploads folder. have tried scour web no avail of has fixed this. keep getting 502 bad gateway error once submit button pressed. commented area storing files database. need file moved @ point. have created quick , dirty little php script uses methods. if stands out please let me know.
<?php /* template name: testfileupload */ /** * created phpstorm. * user: ccombs * date: 7/27/2017 * time: 1:31 pm */ require_once(abspath . "wp-admin" . '/includes/image.php'); require_once(abspath . "wp-admin" . '/includes/file.php'); require_once(abspath . "wp-admin" . '/includes/media.php'); $file = $_files['uploaded_file']; $fileoverride = array('test_form' => false); /*//file upload resume , error checking if($_files['uploaded_file']['size'] != 0) { $externaldb->insert('emp_resume', array( 'resume_name' => $file, 'resume_type' => $file_type, 'resume_size' => $file_size, 'resume_contents' => $file_content, 'applicantid' => $lastid )); } */ if(isset($_post[('submitted')])) { wp_handle_upload($file, $fileoverride); } ?> <?php get_header(); ?> <?php while ( have_posts() ) : the_post(); ?> <?php echo var_dump($file); ?> <? get_template_part( 'content-583', get_post_format() );?> <form action="<?php the_permalink(); ?>" method="post" id="app" enctype="multipart/form-data"> <table> <tr> <td colspan="4" style="font-weight: bold"> attach resume: </td> </tr> <tr> <td> <input type="file" name="uploaded_file"> </td> </tr> <tr> <td><input type="hidden" name="submitted" value="1"> <input type="submit" value="apply" class="btn"> </td> </tr> </table> </form> <?php endwhile; // end of loop. ?> <div><?php get_footer(); ?></div>
i contacted godaddy hosting provider. informed me have "difficult time" uploading .docx files wordpress sites. tested , .doc, .pdf, .jpeg, .png , others uploaded fine. every time went upload .docx file server return bad gateway 502.
Comments
Post a Comment