Jump to content

FTP instead of Browse/drag and drop


pwired
 Share

Recommended Posts

Hi,

In the back end you can upload a picture with the browse button or use drag and drop here.

I noticed the uploaded picture ends up three fold in /site/assets/files/1/

picture.0x100.jpg

picture.232x176.jpg

picture.jpg

I want to upload directly a picture with ftp to /site/assets/files/1/

I assume I have to upload the picture three times

picture.0x100.jpg

picture.232x176.jpg

picture.jpg

Doing so will the picture show up in the website the same way as uploaded with the browse button

or with drag and drop here in the back end ?

Do I have to edit something manually in the database ?

The reason why I want to do this is my weak unstable upload speed when I am on the road

but where ftp still seems to work.

Link to comment
Share on other sites

picture.0x100.jpg and picture.232x176.jpg are size variations dynamically created by ProcessWire. Original image is saved as picture.jpg, that's all.

Directly uploading image with FTP won't do any good, since PW won't know about it, i.e. there's not going to be required metadata to support it. If this image field of yours is called "images", see contents of database table "field_images" for an example. Each uploaded image gets a row of data in table associated with the field it's uploaded to.

I'd still suggest that you don't attempt FTP upload + directly manipulating database content, unless you absolutely have to, as that could result in issues elsewhere.

Link to comment
Share on other sites

@pwired: if you really cannot use the drag-drop upload in the backend, you may use your own ftp upload, separated from the /site/assets/files/ folders. Something like this:

- myImageUpload

- site

- wire

With your uploadfolder you have to create subdirectories with the id of the pages / folders where the images should belong to.

After successfull ftp-uploaded some images you can manually run an importerscript that scanns your uploadfolder and import the images via api. Also this script should delete the images (and folders?) in the uploaddirectory after import into PW.

This way you will not have any drawbacks or side effects with the DB-(meta)data or sanitizing of the imagefilenames etc.

Link to comment
Share on other sites

Thanks Teppo, I blamed my slow speed sim card connection that I use in my car not being stable enough for uploading in the back end. The problem turned out to be the hoster I use. They moved to cloud services and

now websites made with accounts before are not completely compatible anymore with there new cloud system.

I switched quickly to another (not cloud) hoster and now uploading in the back end goes without any problems.

This is going to save my Sunday ^_^

This way you will not have any drawbacks or side effects with the DB-(meta)data or sanitizing of the imagefilenames etc.

Horst, that is a good tip to do these things with the api. I should practice more with the api.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...