uploading images from desktop is fine but the problem is when i need to upload image from
mobile browser give me that error
the file 14343254.jpg could not be saved . an unknown error has occurred
the file in the Photo field was unable to be uploaded
photo field is required
I suggest you to use the devel module for that and in hook_file_presave($file) you should use dpm($file) to test if you get the file object. Try it like this:
function MYMODULE_file_presave($file){
dpm($file);
}
If file_presave doesn't work try the hook_file_insert($file).
Both will run if you press the upload button next to the file field or just hit the save button on node edit/add page and will output the file you uploaded to the screen as an object. If you don't have the devel module get it from here: http://drupal.org/project/devel or if you have drush drush dl devel. Try to check the server error log or the recent messages in drupal at Reports. You may have a duplicate entry for the file uri in the database. Check if you modify the uploaded files in one of your custom modules. I hope it helps you a bit.
i finally solved my problem after 1 week of searching
The problem is i am using aws ec2 server with 8GB volume and its 70% filled so images from mobile camera is large its generate unknown error so when i increase my volume to 50GB the problem is solved
Related
After working on the website without issue for the afternoon, I am suddenly presented with a "Could not insert attachment into the database." error any time I try to upload any files. The size and type of file does not seem to matter.
I have checked permissions and the file upload size and memory limits in WordPress and don't see an issue there. No changes were made between the last successful upload and uploads failing (only a matter of minutes).
I have found that the files are uploading correctly to the file system but are not available within WordPress.
This is likely a MySQL database issue. To find the exact error that's preventing you from uploading media, you can turn on wordpress debug logging by adding define('WP_DEBUG_LOG', true); to your wp-config.php file, then re-create the error, and find the full error message in the debug.log file inside wp-content folder (more detailed instructions can be found here).
In my case, the error was a duplicated primary key when trying to insert into the mac_posts table. The images were actually uploading to the wp-content/uploads folder on the server just fine, but wordpress makes an entry in the mac_posts table for every media item uploaded so it can display it in the wordpress media library. Looking in the database table using phpMyAdmin, the row with the existing ID was a wpforms contact form, so I just deleted that row from the table, re-created the contact form manually, and that fixed the table and the upload issue.
Encountered the same error, figured out it was the length of the image name. Fixed it by renaming to shorter name.
I have created a media type that accepts XML files and saves them to a custom publicly accessible location on the server.
Ideally I would like the file to be overwritten when the exact same file is uploaded. This does not happen, instead it creates a new file and adds a number on the end. I have "Create new Revision" turned off.
To get around this issue I thought I could just delete the file via the CMS. The uploaded file has status of "Permanent" and is used 0 places. I know the cron job cleans up files for you, but when I run the cron the file in question is still there. I figure it's because the file is set to permanent, but I don't see a way to flip this to temporary.
Any help is much appeciated.
There is a setting nested away in the file system settings, which lets you configure it to remove (or not removed) orphaned files. If drush isn't removing them despite having no usages recorded, I'd check this option isn't ticked.
The temporary and permanent status are used for storing temporary files during the upload/save process, so I wouldn't tinker with those too much.
If you fancy making the form yourself using the form API, then you can save the file programmatically using the FILE_EXISTS_REPLACE parameter.
https://api.drupal.org/api/drupal/core%21modules%21file%21file.module/function/file_save_data/8.5.x
I need to set a default image for my new app, so I was thinking about to use the app setting feature.
So I added a new content type of file type, but trying to upload a 20,3 KB file from adam it gives me the following error
The upload failed. The most likely cause is that the file you were trying to upload is bigger than the maximum upload size.
Using the image manager I'm able to upload my image and work with it.
It is an adam issue?
Thanks
most likely it's a forbidden file extension. Check fiddler / network-trafic to see what the real error is.
I've got a very strange problem using drupal 7. I've got a wbesite running and using views and content types I have been able to build a lot of functionality. Now the following occurs:
When I add a new field to a content type (new or existing) of the the type file or image, I have this field in the form but when I try to upload a file or image using this form it gives an error "The file could not be uploaded" or the full error (from the recent log messages): "The upload directory public:// for the file field field_katapult_voorpagina could not be created or is not accessible. A newly uploaded file could not be saved in this directory as a consequence, and the upload was canceled."
Strangely, when I upload a file or image using an older existing field (pointing to the same directory: public://) it does not give an error and the files upload without a problem. So this makes me think that the server settings are actually set properly.
Anybody who can help me with this problem?
If not, can anybody point me in the right direction as to where I can find the files that handle the upload process in drupal 7?
Many thanks in advance!
You need to check a couple of things :
where is your public files folder, and if that is writable by the webserver ( in /admin/config/media/file-system )
where does your working field send files (it might be a different directory), and if it is, use that for the new fields as well.
Check you file destination directory setting of new image field. Do not include preceding or trailing slashes. This field supports tokens.
You can also check max, min resolutions, file upload limit, image style (if it is new image style other than thumbnail/ or existing) & number of values ( if it set to 1 you can't upload 2 or more). Finally you have to set it public files type.
I think you should check the files folder permission.
I'm newbie in using eucalyptus. I need to download modify a prepackaged image. I use command
euca-download-bundle
to download it. It has a required parameter - bucket.
I want to download this image.
mi-E07C107C
image-store-1297468153/image.manifest.xml
eki-F6BE10FF
eri-0B3C116B
but I always get error -
Unable to get bucket
Here are the commands I tried:
euca-download-bundle -b image-store-1297468153
euca$ euca-download-bundle -b /var/lib/eucalyptus/bukkits/image-store-1297468153
you may not be able to download the bundle if you are not the same user who uploaded it. For example, if admin uploaded that bundle, but the user aleksey is the one trying to download it, that would be the error you get.