Smf image upload troubles - php

Folks, kindly help me.
Have the following issue with smf 2.0.4 (latest)
User cannot upload image even the smallest one. Other file extensions pass well.
Tried the following:
tracking $_FILES - no errors,
uploading as admin, adding extra attachment folder, checking server free space, forum setting for attachment limits set to maximum. Also have increased all possible php.ini limits. Chdmod is 755 for all folder, tried also 777 for attachments folder.
Kindly tell me what could be wrong ?
my phpinfo is here http://tinyurl.com/bqxchl8
The error message is as follows:
Your attachment couldn't be saved. This might happen because it took too long to upload or the file is bigger than the server will allow.Please consult your server administrator for more information.

3 months later, but wth...
Check you SMF Admin, where the Attachments and Avatars category Attachment Settings is located, and be sure that the image file you are uploading has a file extension that is located within the comma separated list for the Allowed attachment extensions setting.
There are other setting in there that you will need to change as well, such as:
Max attachment folder space
Max attachment size per post
Max size per attachment
Max number of attachments per post
Also, make sure Perform extensive security checks on uploaded image attachments setting is UNCHECKED. This can cause rejected image attachments, since this is somewhat buggy in SMF.
If you set all of these settings to 0, than it will be UNLIMITED! Therefore, no restrictions whatsoever on these.
If you still have a problem uploading image files, than go back to the Admin -> Attachments and Avatars -> Attachment Settings and uncheck: Re-encode potentially dangerous image attachments
Good Luck and hopefully this helps.

Related

Cannot Upload .GLB to Wordpress Media Location

This is not a quick failure, I have spent a totally of 5 completely full days trying to figure this out. Initially I was limited by file size and then file type; in which I removed the Wordpress restrictions and am now "capable" of uploading my 177MB .glb file to Wordpress.
However when doing so, I receive the following error:
retriever.glb
Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page.
I was on the phone with GoDaddy Specialists for 2.5 hours yesterday ensuring that this was not a Server issue or restriction on their side.. they confirmed that it was not. We pretty much ended the conversation that it is something I must figure out with me, myself, and I.
I went ahead and uploaded my .glb to the server through panel, everything worked fine. In fact I have a location for it here: https://www.tattiniboots.com/wp-content/uploads/2020/07/retriever.glb
However, this does not make the file discoverable to the 3D viewer plugins I have installed on the site through the media location.
I truly don't know where to go from here
I changed the name of the file to .png and attempted an upload and received the following error:
Post-processing of the image failed likely because the server is busy or does not have enough resources. Uploading a smaller image may help. Suggested maximum size is 2500 pixels.
I just tried to update a normal .mov file that is 150MB and received the following error; really making me think this is something to do with file size:
Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page.
Yes, normal images are uploading just fine (2MB-ish)
I just attempted to deactivate all plugins with consideration that maybe "Smush" or another was imposing issues: I then received the issue that the file type is not supported (even with the allow all file types code in my wp-config)
Is this just the case that glb is not allowed at all?
This must be a server thing. probably a run time error
Whoever supported you just doesn't know it. GoGoDaddy. ;)
Nevertheless... you can Use a plugin that's called
media sync. Check it out and best of luck

WP Contact Form 7 unable to send attachments

File attachments for a CF7 form stopped working recently. I can get the emails, but no attachments. Its for resumes, so only allowing pdf, docx, doc. Here's what's happening so far:
Form tab:
<label>Upload Your Resume or Portfolio (limit 2MB)</label>
[file resume filetypes:pdf|docx|doc id:resume class:form-input-text limit:1000000]
Mail tab, attachments field:
[resume]
Hosting: Godaddy
SMTP plugin: Easy WP SMTP
Only other plugin (other than CF7): Adminimize
wpcf7_uploads folder permissions 755
uploads folder permissions: 755
When I upload a file, the file doesn't appear in the temporary folder (wpcf7_uploads) at all
Fixes I've tried:
Attachment deleting after 60 secs
Did everything on this page
Also tried this fix
Tried sending form with all other unnecessary plugins deactivated
Increased file size allotment to 2mb. Sending a 6kb docx file doesn't work
This solution didn't work either
Unable to find any errors in the server logs
Tried allowing images, but didn't get any images back
Tried setting both Uploads and wpcf7_uploads permissions to 777, no luck
Tried everything in the comments on this page
If anyone else went through this whole process and found a fix, please let me know. Thanks!

PHP POST upload of files > 8.2M fails

I am using the script posted here by w3school for uploading files to a webserver. I am using Google chrome going to an Apache server with php7.
When I upload a file from my windows desktop the script works as advertised and the file is uploaded. However when I attempt to upload a file from any other folder the $_FILES variable is either not there or it's values are empty (It actually appears to be a size issue, see edit below). I'm not sure how to troubleshoot this as the devtools on chrome don't seem to give me any information about what it is sending in this POST message.
I am assuming the problem is on the client side as it appears the server is getting no information from the client.
EDIT
I am aware of how to look at the headers for requests and nothing about the file except for its content length are included in the header. There is no difference between the headers that work and those that don't except the content boundary, which appears to be random, and the content-length header, which obviously changes with the size of the file.
I had a thought that this was related to the size of the file, and it is. I have a folder of different size photos and I sorted and uploaded increasingly larger files until it failed. It worked fine until around 8M files, and fails when they are larger than 8,200KB.
I checked the php.ini and I have it set to a max upload size of 150M, so it's not the ini file. I also check all the logs and nothing other than the post request shows up when I try to upload the file.
I was able to find the answer here: why would $_FILES be empty when uploading files to PHP.
I did not know there was a post_max_size option in the php.ini file, which was set to 8M. Now that this is set to 100M. If you go over this size of a POST request php does not parse the POST information, thus giving you a blank $_FILES variable.

MyBB attachment not showing up

I am experiencing a quite weird issue on my client's MyBB instance. Attachments upload works, but I can't see them when readin the thread after saving the modifications.
At first I thought it was a permission issue (chmod or htaccess), but the upload works. I can see uploaded attachments in the "/uploads/201503/" folder. I see one thumbnail file and another one with the ".attach" file extension, which is in fact my jpg image when renaming the ".attach" extension to ".jpg". So upload works.
Now looking at the database "attachments" table, I can see the uploaded attachment row. The "attachname" field shows "201503/post_2_1425271978_8162c40a2a603edc2b441bd78460f9a7.attach", which is exactly the my uploaded attachment. So, persistence to database works.
I tried removing all my htaccess files and putting chmod to 777... negative. It's not going anywhere.
Does anybody here already faced that issue?
I have searched the forum before posting.. some very old threads have showed up, but unfortunately the op did not post the solution.
I got no error/warning message whatsoever.
Many thanks for help.
Charles
Check that attachments size in db and real size are the same. If they are not, Content-length will be wrong and some browsers just fail.
Also, simply check that the permissions are such that guests can't view the attached image.

PHP file uploads being "hijacked" by partial uploads

I have a site that is receiving 30-40k photo uploads a day and I've been seeing an issue pop up with more frequency now. This issue is this:
Our upload script receives (via $_FILES['name']['tmp_name']) a file (photo) that was NOT uploaded by the user & the majority of the time the file received is a "partial" upload.
Of course at first I thought it was my PHP code making a simple mistake and I've spent days looking over it to make sure, but after placing checks in the code I've found that the file received via a HTTP POST upload to PHP is actually the wrong file. So the issue is happening before it reaches my code. The tmp file (phpxxxx) received by the script is sometimes incorrect, as if it was somehow being overwritten by another process and its usually overwritten by a file that was partially uploaded.
Has anyone every seen an issue like this? Any help is greatly appreciated. I'm turning to this as a last resort after days of searching/asking other PHP devs
So to recap:
User uploads a photo
PHP script receives a file that was not uploaded by the user (pre code, via $_FILES in /var/tmp)
Usually the incorrect file received is a partial upload or a broken upload
It seems to happen randomly and not all the time
First off, check you PHP version.
Second, check your file upload limits and POST_MAX_SIZE in php.ini
It might just be that someone tries to upload a file that's too large :-)
Can you try different names for the temp file to avoid its being overwritten? Can you identify the origin of the new, incorrect and incomplete file?
Is this a development environment? Is it possible that more than one user is uploading files at the same time?
Try your program with very small images to check if SchizoDuckie is correct about filesize problems.
Try with different navigators to eliminate the admittedly remote possibility that it is a local problem.
Check permissions on the directory where the temp file is stored.
PHP's built-in file handling does not support partial uploads.
Turn off KeepAlives and/or send a 'Connection: close' header after each upload.
Configure your webserver to send the header 'Allow-Ranges: none'.

Categories