Original $_POST (file) values not available in SC

I’m trying to access the original filename to store in a DB against a GUID that is set upon saving to S3 so that the user can then download with the original filename.

I used to use (within a repeat of the upload step)

$_POST.upfiles[$index].name

But having set up a form which uploads files (I can see them successfully saved in the uploads folder on the server so I know the upload works) I can’t seem to access the original $_POST array for the files:


Produces:
image
and I can’t seem to use the name value as I have always done in the past (there should be the details of 2 files in this test). I have also tried addressing to the name field directly.

When using it before it was on PHP, maybe on this NodeJS project it’s handled differently. Any help would be appreciated!

would your set value be sometime closer to = {{$_POST.upfiles}} or would you need to assign an array and add the values via a repeat?

Thanks @baub
I tried that ({{$_POST.upfiles}}) but it still didn’t work. You don’t seem to be able to access uploaded files as $_POST values from SC for some reason. I just wanted to get the original file names…

maybe it is a node.js thing? I’ve not done anything with that.

Or maybe just set up table in the database that you save the filenames and ID’s to and then just call the db table with the query when you need that info?

That’s what I’m trying to do…
I just can’t access the original file name to store it in the DB - the upload step creates a name using guid which I can’t use so the only way I found (which now doesn’t seem to work - poss. Nodejs thing) is to access the $_POST.

can you post rest of the service connect script?

are you using 3.x still or are you using the beta 4.x version?

This is on W4 B9

If you look at the first post, there’s a couple of screenshots. The first shows the SC steps - the $_POST variables are set up and the first step is to output anything that was sent. You can see from the second image that outputting the whole of the $_POST shows the other variable (repoid) and recognises that upfiles is sent but I think something might be overwriting it in the SC code.

I have also tried adjusting the code to $_POST.upfiles[0].name to individually output the first filename - no dice.

The next step is a file upload step which works because I can see the files being uploaded and saved to the server which demonstrates upfiles is populated and contains valid information.

there are more steps though right to the SC script. Didn’t know if something was missing in the upload step or something. What you are trying to do should be pretty easy. But I’m guessing you are using the s3 uploader and not the regular html upload for images? thats why i was curious to what else was in the script?

I’m guessing you might need some @patrick love on this one?

1 Like

looks like some s3 improvements in the beta 10, maybe your issue might be repaired there?