Skip to content
This repository has been archived by the owner on Jun 19, 2020. It is now read-only.

refs #525 Allow to upload multiple files at once #526

Closed
wants to merge 11 commits into from
Closed

refs #525 Allow to upload multiple files at once #526

wants to merge 11 commits into from

Conversation

nikrou
Copy link

@nikrou nikrou commented Jul 9, 2013

I wrote a simple test.
The code to be updated is in fillForm() method and can be surely improved.

}
this.page.uploadFile(fileFieldSelector, file.path);

if (utils.isObject(file.path) && file.path.length>1) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use 4 spaces indentation, and add spaces around operand (>)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

@henvic
Copy link

henvic commented Jul 24, 2013

This would be a nice addition.

Any updates on it yet?

@n1k0
Copy link
Member

n1k0 commented Jul 24, 2013

I'm in holidays using a crappy edge connection, maybe @laurentj could have a look? Also, AFAICS tests are failing.

</head>
<body>
<form action="result.html" enctype="multipart/form-data">
<input type="file" name="files[]" multiple="multiple">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation problem here

@n1k0
Copy link
Member

n1k0 commented Aug 12, 2013

Poke.

@nikrou
Copy link
Author

nikrou commented Aug 12, 2013

I was in holidays.

@n1k0
Copy link
Member

n1k0 commented Aug 12, 2013

No pb take your time:)
Le 12 août 2013 17:34, "Nicolas" notifications@github.com a écrit :

I was in holidays.


Reply to this email directly or view it on GitHubhttps://github.com//pull/526#issuecomment-22501981
.

@nikrou
Copy link
Author

nikrou commented Aug 13, 2013

I fix indentation and simplify a bit code in modules/casper.js
All tests are ok.

Casper.prototype.getFileFieldSelector = function getFileFieldSelector(selector, file) {
"use strict";
if (file.type === "names") {
return [selector, 'input[name="' + file.selector + '"]'].join(' ');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please take care of the indentation

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

throw new CasperError('Cannot upload nonexistent file: ' + file_path);
};
fpaths.push(file_path);
}, this
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please pass the map function inline: paths.map(function(filePath)…; also, use camel case var/method naming

@n1k0
Copy link
Member

n1k0 commented Nov 27, 2013

The patch looks good, though some minor CS issues to be addressed. Also, please ensure to rebase on top of latest master.

(Sorry for the latency, I've been quite busy with other fronts these last months)

@albuquerque
Copy link

I came across this when trying to upload multiple files to an HTML5 file type input element. Applying the changes in casper.prototype.fillForm and the new function casper.prototype.getFileFieldSelector makes the functionality work. I understand that there are some minor coding standard issue. I am not sure if @nikrou has any plans to submit and update especially since it's more than 2 years old. Could the issues be fixed and merged please?

@mickaelandrieu
Copy link
Member

@albuquerque can you apply the update in a new pull request and submit it ?
@istr is (mostly) the only active maintainer (no offense, others: you are all great :).

It's the best chance to get this feature accepted atm 👍

@albuquerque
Copy link

Will do @mickaelandrieu. I didn't touch the tests. Will update it and submit.

@istr
Copy link
Collaborator

istr commented Mar 22, 2016

Abandoned. Closing in favor of #1425 that is about to be merged.

@istr istr closed this Mar 22, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
6 participants