Upload Image To Host - Forum

Forum Navigation
You need to log in to create posts and topics.

Upload Image To Host

Hi Friends,

I use this script to upload the photo selected by the user on the host in the desired path with the desired name. But unfortunately, it changes the size of the photo. I want the photo to be uploaded on the host with exactly the same original dimensions and not cropped or stretched.

fabLoadFile "npc_icon_preview" "logoImage"
GetObjectInfo "npc_icon_preview" "width" [theWidth]
ToNumber "[theWidth]" [theWidth]
GetObjectInfo "npc_icon_preview" "height" [theHeight]
ToNumber "[theHeight]" [theHeight]

Wait 400
  fabGetProperty "npc_icon_preview" "logoImage" "width" [imageWidth]
  fabGetProperty "npc_icon_preview" "logoImage" "height" [imageHeight]
  Math "[imageWidth]/[imageHeight]" -1 [imageRatio]
  Math "[theWidth]/[theHeight]" -1 [containerRatio]
  If [imageRatio] > [containerRatio]
     fabScaleToWidth "npc_icon_preview" "logoImage" [theWidth]
  Else
     fabScaleToHeight "npc_icon_preview" "logoImage" [theHeight]
  EndIf
  fabCenterObjectHorinzontal "npc_icon_preview" "logoImage"
  fabCenterObjectVertical "npc_icon_preview" "logoImage"
EndWait

Wait 1000
     fabUnselect "npc_icon_preview"
     fabSaveAsBase64 "npc_icon_preview" [base64Data]
     wait 500
          neoPhpSetPath "https://laminapp.com/Centrum/Apps/JAAAK/lkfORvhbc68vcqKL7kdTQ/tz4eAQSJSAcwBao7EjV5JT.php"
          neoPhpFileWriteFromBase64 "[npc_id]_icon.jpg" "[base64Data]" ""
     endwait
EndWait

 

@notweb this topic has been discused several times in the forums.
There are many possible options. Easiest one is probably this free plugin.

Regards.

Thank you but can you help me to use it?

@notweb, please check this thread:
https://visualneo.com/forum/topic/upload-multi-image-by-user