• Resolved rmcmorran

    (@rmcmorran)


    Using the user_submitted_posts upload form, I want to allow the user to upload photos directly from their mobile camera (iPhone etc). At the moment, the upload fails if the user selects “Take photo” when the file input is activated. Is there a setting or shortcode that has be used?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jeff Starr

    (@specialk)

    Glad to help. When it comes to uploading files, there are many, many variables involved. From the server setup/configuration itself all the way to your WP installation and plugins/theme, there could be any number of reasons why uploads are not working.

    That in mind, the most common issue with mobile uploads is that the files are too large for your existing server configuration. Web hosts commonly put limits on the size of allowed uploads and so forth. So my best advice is to either increase server limits and try again, and/or do some troubleshooting of your file upload process. Here is a guide that explains some important things to investigate.

    Let me know if I can provide any further infos, glad to help.

    Thread Starter rmcmorran

    (@rmcmorran)

    Thanks for the input. Yes, filesize can have a bearing, but in this instance I discovered it was the “Maximum image width” setting in the plugin settings. Camera uploads don’t seem to trigger the inline error message if the photo exceeds the max width. I simply increased the width and the problem was fixed!

    Which has given rise to a secondary issue with camera uploads. On the iPhone, the image name is “image.jpg”. This is a problem as soon as another camera photo is uploaded as it has the same filename and simply overwrites the previous one, so we end up with duplicate images. Is there any plugin setting to set a unique filename (e.g. append a timestamp value) to prevent this from happening?

    Plugin Author Jeff Starr

    (@specialk)

    Ah, that actually sounds like a bug. I will get it fixed up in the next version with a unique appended string or something similar. Will include a filter hook for customization. Thank you for the feedback, please feel free to post again with any further/related infos.

    Thread Starter rmcmorran

    (@rmcmorran)

    Oh well that’s good news then! If I can get that bug sorted, it’s going to work great for us! If you remember, let me know when an update is released, but I’ll try to keep checking anyway. Thanks!

    Plugin Author Jeff Starr

    (@specialk)

    Just to follow up, there is a filter that may be used to customize the names of uploaded files. Just hook into usp_filename_append and modify as needed. By default, the append value is empty for single files. But when multiple files are uploaded, the append value becomes, -1, -2, -3, and so forth for each image. So with the hook, you want to append your random string instead of replacing. To learn more about this hook, you can find it in usp_attach_images(), located in user-submitted-posts.php.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Mobile camera images’ is closed to new replies.