Viewing Upload files

Upload files



User: itay 8 years ago
Option to upload files in the form will be great !! That will be sent to the mail as an attached files..
User: John C. 8 years ago
I agree. It would be great to be able to let visitors add attachments when using the contact form.
User: Roddy 8 years ago
The problem with allowing file uploads is that it increases the security risk. The formmail script I have used for the Form widgets disallows this by default.

A file upload field would be a lot more secure and less open to abuse if it was on a password protected page. Setting this up for multiple users is probably not the kind of thing the average user would want to undertake.

You would also need to contact your hosting service to make sure the PHP installation allows file uploads and what restrictions there are - if any - on the file size and/or type.

-------------------------------
Roddy

Website: http://everwebwidgets.com
Contact: http://everwebwidgets.com/ewWidgets-home/contact.html
NOTE: I am an EverWeb user and NOT affiliated with EverWeb! Any opinions expressed in this forum are my own.
User: Chris B. 8 years ago
Does anyone know if everweb hosting supports PHP or are you locked to simple uploads from the app itself?.
Only asking as im thinking of migrating my site over but I use PHP scripts I wrote within my site.

Chris
User: Roddy 8 years ago
Yes, it does.

-------------------------------
Roddy

Website: http://everwebwidgets.com
Contact: http://everwebwidgets.com/ewWidgets-home/contact.html
NOTE: I am an EverWeb user and NOT affiliated with EverWeb! Any opinions expressed in this forum are my own.
User: itay 8 years ago
It does?? How exactly do I upload the files?
If for example I have my everweb website hosting in everweb,
And I add html snippet for reading data from database or something like this,
And I make a PHP file that I want to upload it to the FTP of the website I am hosting in everweb..
How do I upload the PHP file?
I mean as far as I understand there is no ftp address in everweb hosting that I can just upload any file from other software's,
The hosting of everweb is for everweb sits from the everweb software only, no?
and if yes, there is an option in everweb to upload files like PHP scrips (that will support my html snippet)?
User: Chris B. 8 years ago
Itay you want to be careful here as if you can upload from within the Everweb app in not sure you be able to address a PHP script in another folder. I keep my PHP scripts well away from my main site, especially my DB Connection script.

Im really not sure you can FTP directly into the webspace and pop folders and files where you want them.

Remember this application is designed to make FTP as easy as possible for people who are not used to the protocol.

I could be wrong

Chris
User: Chris B. 8 years ago
Again (see my example code below).

<html>
<body>
<form method="post">
<label for="file">Filename:</label>
<input type="file" name="file1" id="file1" />
<br />
<input type="submit" name="submit" value="Submit" />
</form>
</body>
</html>
<?php
if(isset($_POST['submit'])) {
if ($_FILES["file1"]["error"] > 0) {
echo "Error: " . $_FILES["file1"]["error"] . "<br />";
} else {
echo "Upload: " . $_FILES["file1"]["name"] . "<br />";
echo "Type: " . $_FILES["file1"]["type"] . "<br />";
echo "Size: " . ($_FILES["file1"]["size"] / 1024) . " Kb<br />";
echo "Stored in: " . $_FILES["file1"]["tmp_name"];
}
}
?>

You will require a safe repository for the file to be stored in your web space.
Thinking about space, location (folders) and security this could become difficult within EW.
User: Paul-RAGESW 8 years ago
You're much better off using a service for this, or if you have the technical skill, Amazon storage to store files.

You have limited space on your EverWeb accounts and accessing these files will be difficult. You also open up your account a lot of security issues.

I very highly recommend a third party service for this until we are able to provide a proper solution built in.

-------------------------------
Paul
EverWeb Developer
User: Roddy 8 years ago
The original question was about having a file upload input on a contact form. The easiest way to do this is to have the file attached to the recipient email so no server storage is required.

-------------------------------
Roddy

Website: http://everwebwidgets.com
Contact: http://everwebwidgets.com/ewWidgets-home/contact.html
NOTE: I am an EverWeb user and NOT affiliated with EverWeb! Any opinions expressed in this forum are my own.
User: itay 8 years ago
Thanks guys,

Chris, I couldn't understand what you mean, I hope you explain from beginning.

I have the everweb website that I host in everweb.

I want to be able to read data from sql database

For the catalog page (instead of using the gallery gadget), I want to built a catalog page in html (use the html snippet..) with menu, search field etc. that will return from the database pictures, item numbers and descriptions etc.

I have my database located outside everweb of course,

Now how do you think I should do it?
Where should I locate the php file?

As far as I know, if I will place the php not in the same ftp folder where is the main site and I will use only the html snippet it will not be safe no?
User: Chris B. 8 years ago
Itay,

If you have an external dbase im assuming you have a MySQL database for this then the chances are you have some hosting with the company you have this database with.

You could put a simple contact form with a file upload option (like my example above - you could even copy and paste this) in the other hosted space and link to it from EW with a simple HTML snippet i.e call the page in via iFrame.

Like Paul said EW cannot do this yet.

If you try the code I put above in a file such as test.php this will give you a good starting block to build your own upload form from.

Chris
User: Chris B. 8 years ago
Also as Roddy suggested if you don't want to store the files on the server you can parse these with the PHP mail command to send the file (example below):

$email = new PHPMailer();
$email->From = 'you@example.com';
$email->FromName = 'Your Name';
$email->Subject = 'Message Subject';
$email->Body = $bodytext;
$email->AddAddress( 'destinationaddress@example.com' );

$file_to_attach = 'PATH_OF_YOUR_FILE_HERE';

$email->AddAttachment( $file_to_attach , 'NameOfFile.pdf' );

return $email->Send();

I hope this points you in the right direction.

Chris
User: Chris B. 8 years ago
Itay,

If you have an external dbase im assuming you have a MySQL database for this then the chances are you have some hosting with the company you have this database with.

You could put a simple contact form with a file upload option (like my example above - you could even copy and paste this) in the other hosted space and link to it from EW with a simple HTML snippet i.e call the page in via iFrame.

Like Paul said EW cannot do this yet.

If you try the code I put above in a file such as test.php this will give you a good starting block to build your own upload form from.

Chris
User: itay 8 years ago
Many thanks Chris !
Your answers are very helpful


Post Reply
You must login or signup to post.