Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: Upload file on a button



Permlink Replies: 3 - Last Post: Dec 20, 2016 5:24 AM Last Post By: Jose Nilton Pace
grega loboda

Posts: 44
Registered: 2/5/10
Upload file on a button
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 14, 2016 10:17 AM
Hi. Is it possible to make IWFileUploader look like a button? I would like a button there for the user to upload a file. I have buttons all over my app but uploading looks like a link and I don't like that.

Grega
Eitan Arbel

Posts: 452
Registered: 2/24/13
Re: Upload file on a button
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 15, 2016 7:15 AM   in response to: grega loboda in response to: grega loboda
i never used or tried the TIWFileUploader, so i don't know the answer to that exactly, but it can easily be done with CG FileUploader if you have it
Alexandre Machado

Posts: 1,684
Registered: 8/10/13
Re: Upload file on a button
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 19, 2016 1:14 PM   in response to: grega loboda in response to: grega loboda
grega loboda wrote:
Hi. Is it possible to make IWFileUploader look like a button? I would like a button there for the user to upload a file. I have buttons all over my app but uploading looks like a link and I don't like that.

Grega

You can apply your own style (using CSS) to it. However there are many different CSS classes you have to cover. I'll create a simple demo for you so you can change it using your own styles. I'll let you know when ready.
Jose Nilton Pace

Posts: 92
Registered: 5/15/98
Re: Upload file on a button
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 20, 2016 5:21 AM   in response to: grega loboda in response to: grega loboda
Hi Grega. I do the same using bootstrap, is not elegante in Delphi and is not elegante in template, BUT, is marvelous to Client. Do this stuff:
in your IWFileUploader Set
ButtonVisible := False;

put iwbutton with your css and ScriptEvents, onClick:
IW.FileUploader("YOURIWFILEUPLOADER").selectFile();

in your template, something like this:
<div class="form-group">
  <button type="button" class="btn btn-primary btn-block" id="IWBUTTON"><i class="fa fa-upload fa-fw" aria-hidden="true"></i> Send Image </button>
  {%YourIWFileUploader%}
</div>
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02