> My issue is that I need to parameterize some values in the files that
> get uploaded. Any idea of how to do that? I could create a large
> number of unique files then parameterize the file name in the
> web_submit_data, but that is a pain.
One way would be to use C file handling functions to open and modify
the file with the parameters before uploading it. But depending on how
much you need to modify the file (you may have to seek to the right
place in file and then replace/append the parameter) and how many
users will be simultaneously running during the load test, it can
potentially cause too much disk usage on your agent machines.
> Better still, would be if there is a way simply generate a string in
> memory them pass it to the POST so that it looks like it is attached as
> a multipart/form-data.
It may be possible to create a manual web_custom_request using raw
HTTP request. I haven't done it but sounds challenging & fun. You can
use Webscarab to get the raw HTTP request. Basically, the body of the
request will have the contents of the file and will be something like:
-----------------------------25723100747689
Content-Disposition: form-data; name="File"; filename="readme.txt"
Content-Type: text/plain
test
-----------------------------25723100747689--
where "test" is the actual content of the file. Now you can
parameterize it however you want (atleast for ascii files). More info
on HTTP file uploads here: http://www.ietf.org/rfc/rfc1867.txt
Hope it helps,
Gaurav
--- In Advanced-LoadRunner@yahoogroups.com, <msm@...> wrote:
>
> I am unclear on what happens under the covers when a file is uploaded to
> a web site. From the Generation Log file, it appears that LoadRunner
> reads the file(s) at run time, packages them together, and sends them to
> the server as an attachment to a single POST request. Is that right?
>
>
>
> My issue is that I need to parameterize some values in the files that
> get uploaded. Any idea of how to do that? I could create a large
> number of unique files then parameterize the file name in the
> web_submit_data, but that is a pain.
>
>
>
> Better still, would be if there is a way simply generate a string in
> memory them pass it to the POST so that it looks like it is attached as
> a multipart/form-data.
>
>
>
> This is my captured/modified web_submit_data statement.
>
>
>
> web_submit_data("File Uploader",
>
> "Action=http://xyz.com",
>
> "Method=POST",
>
> "EncType=multipart/form-data",
>
> "RecContentType=text/html",
>
> "Mode=HTML",
>
> ITEMDATA,
>
> "Name=file0", "Value=C:\\temp\\CustomerOrder.dat", "File=Yes",
> ENDITEM,
>
> "Name=file1", "Value=", "File=Yes", ENDITEM,
>
> "Name=file2", "Value=", "File=Yes", ENDITEM,
>
> "Name=file3", "Value=", "File=Yes", ENDITEM,
>
> LAST);
>
>
>
>
>
> [Non-text portions of this message have been removed]
>