JotForm Microsoft Power Automate - Upload file to OneDrive from URL - Extracting filename from URL

  • insightoverseas
    Asked on April 20, 2020 at 12:36 PM

    I managed to get JotForm and Microsoft Onedrive work through Microsoft flow, however, I'm stuck at file extensions as shown in the tutorial I entered input in destination file path as Applications/01Name.pdf, the problem is when someone is uploading a doc or any other format it is renaming the file name to 01Name.pdf my question is how I can retain the file extensions as it were uploaded by the user.


    I also tried leaving it blank and it's making the file extensionless 

  • Mike
    Replied on April 20, 2020 at 3:24 PM

    Could you please perform a test by adding the File Upload field variable to the Destination File Path to see if it works?

    Example:

    JotForm Microsoft Power Automate   Upload file to OneDrive from URL   Extracting filename from URL Image 1 Screenshot 20

  • insightoverseas
    Replied on April 21, 2020 at 2:01 AM

    Hello Mike,

    I tried but the flow isn't working, the flow just fails and no file is uploaded to Onedrive.

  • Ashwin JotForm Support
    Replied on April 21, 2020 at 5:01 AM

    It seems you have added one more thread where you are saying that you are getting 404 error message. Do you mean to say that now the files are being uploaded successfully to OneDrive but shows 404 error message?

    We will wait for your response.

  • insightoverseas
    Replied on April 21, 2020 at 5:21 AM

    Dear Ashwin,

    Files are now uploading successfully without a 404 error message. The problem is the uploaded files are not being saved as it was uploaded by the user. For example, if a user uploaded his Resume in doc format it is being saved as .pdf (please find the flow screenshot below). 1587460639Flow 7 (2) Screenshot 10


    I tried without adding .pdf in the extension and keeping it as advised by Mike by adding only the File upload variable and the flow is not working. Also tried without adding .pdf extension it is leaving uploaded files without any file extensions.

    Regards

  • Mike
    Replied on April 26, 2020 at 10:17 AM

    Sorry for the delayed update. You can use the next Expression in your flow to extract the filename from the URL:

    last(split(upload-field-value-here,'/'))

    1587910524record Screenshot 10

    This will split the URL using the / separator, and then select the last element which is the filename in our case.