We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

File

Development and Programming

tpayton's avatar
tpayton
172 posts
17 years ago
tpayton's avatar tpayton
Dane nails it, to get multiple downloads just drop allow_multiple=yes into your Image Properties.

It would be even nicer if it was a check box for multiple image in settings for an individual custom field. At little less cryptic and perhaps easier to remember when troubleshooting.

(So when is EllisLab going to buy this thing, give Mark tons of money and built it into EE?)

       
Mark Huot's avatar
Mark Huot
587 posts
17 years ago
Mark Huot's avatar Mark Huot

tpayton - I’m looking into simplifying this now. For the 3.1.0 release we’ll have checkboxes and text fields, instead of a cryptic query string.

       
Bruce2005's avatar
Bruce2005
536 posts
17 years ago
Bruce2005's avatar Bruce2005
{[custom_field]}
{file_url}
{/[custom_field]}

I was trying this, after I realized the file extension outputted the link lol, adding the rel tag is clear now!

However, when I add the tags above, the tags show

{[custom_field]} http://www.bkdesign.ca/pathto/song2_1.mp3 {/[custom_field]}

In the article exactly as above. The field name is file_ext so it shows the url but the custom fields part shows in code,,, (I have 2 files, so tried showing both, or even one) One shows if I use the field tag alone ok. So tried:

{[custom_field]} {file_url} {/[custom_field]}

Template shows code not file exactly as above…??

       
rick.prince's avatar
rick.prince
111 posts
17 years ago
rick.prince's avatar rick.prince

You’d be correct in assuming that I’m running on a shared server. But I assume so are alot of other people? The settings are…

open_basedir VIRTUAL_DOCUMENT_ROOT:/usr/local/lib/php:/usr/local/lib/ph:/home/ilisys/phplib/ safe_mode Off safe_mode_exec_dir /usr/local/php/bin safe_mode_gid Off safe_mode_include_dir no value
       
Mark Huot's avatar
Mark Huot
587 posts
17 years ago
Mark Huot's avatar Mark Huot

rick.prince - The problem is open_basedir does not allow me to @copy() the uploaded file out of your /tmp directory because it’s not within your open_basedir. I wrote the upload script with @copy() because I perform all the resizing/shuffling within the /tmp directory, however this doesn’t seem to be the best approach so I’ll revert to the, probably, preferred method of @move_uploaded_file() for 3.0.1.

       
Dane Thomas's avatar
Dane Thomas
139 posts
17 years ago
Dane Thomas's avatar Dane Thomas

This might be a long shot, but would there be any interest in developing this further to give some feedback during the upload?

I realise that the upload takes place on the entry submission so maybe there is too much to change for this, but I’m just setting up a video upload weblog and it would be great to get some feedback on the upload rather than just waiting for a loading icon to stop spinning.

I saw these two:

http://www.srmiles.com/freestuff/ajax_file_uploader/ http://swfupload.mammon.se/

The first one gives file size and speed which is nice. I know this is overkill for images, but for upload PDF’s and videos it would be a great addition (as FTP for the end client isn’t going to be the best idea).

       
Mark Huot's avatar
Mark Huot
587 posts
17 years ago
Mark Huot's avatar Mark Huot

Dane Thomas - That’s a possibility, and something to look forward to in an upcoming release, maybe 3.1.1? I don’t know if I’ll use Flash, but you can certainly expect an AJAX-ified spinner during upload.

       
rick.prince's avatar
rick.prince
111 posts
17 years ago
rick.prince's avatar rick.prince

Thanks Mark, I’ll look forward to the next release (constantly. every 20 seconds).

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
17 years ago
Mark Bowen's avatar Mark Bowen

Hiya,

Just to drop in my two penneths worth on this one.

Mark first of all your extensions are fantastic so thanks for those!! 😊

I would love to see an AJAX upload utility in place and think that the real boon for use would be from within an SAEF. I don’t think that in the EE control panel there is really any call for it but in an SAEF it would be fantastic. I can see an issue with it though and not too sure how you would handle it Mark?

I think the main problem would be :

Would this be in a pop-up window or would it work in the same window? I would personally love for it to be in the same window. What I would love to have happen is the person fills out the SAEF. If they try to submit the form without the file chosen then they would be warned. There could be the option here to allow the person to carry on or halt the form sending process altogether. Next up if they have to choose a file then they would click on choose and the standard dialogue box would come up asking for a file. They would choose the file and as soon as they have done so it would start uploading and show a progress bar. I think the most important thing here would be that there would need to be something in place that would allow them to delete the upload as it is going if they realised that they had chosen the wrong file or something. If the file did get all the way and upload then they would be presented (on the same page) with a small (configurable) thumbnail that would show them the file they just uploaded (very useful for images). They could then see if this was definitely the one they wanted. At this point they could still delete the file if needed.

Once they have chosen a file then they could submit the form.

I think if it worked in this way then all bases would be covered and should stop most problems that may arise from doing it in this way with an AJAX up-loader. As I said before I’m not too sure if this would be totally necessary in the control panel but with SAEFs this would be absolutely fantastic.

Hope you can add in all these options to it Mark as it will be one beast of an addition if you could.

Just my thoughts though! 😊

Best wishes,

Mark

       
APGWest's avatar
APGWest
295 posts
17 years ago
APGWest's avatar APGWest
svh1 - You can set up separate Upload Locations for each field, meaning you could have different settings for each field. As for setting the file size limit, within each Upload Location you can set the `Maximum File Size (in bytes)` which will limit what’s uploaded to each field.

OK but I guess I’m confused on where these settings are. Do I put them in the tag itself, are they in the settings panel in Admin › Utilities › Extensions Manager, or do they show when I choose “File” when creating a new custom field? I know I could go find out myself but I am running 2.1.0 and don’t want to dink anything up without at least first knowing the direction I should be headed. 😊

       
Mark Huot's avatar
Mark Huot
587 posts
17 years ago
Mark Huot's avatar Mark Huot

svh1 - You can set these by choosing Admin » Weblog Administration » File Upload Preferences and placing a query string of parameters into the Image Properties field.

       
APGWest's avatar
APGWest
295 posts
17 years ago
APGWest's avatar APGWest

Got it, thanks. Now what if I wanted to allow in the Publish page of a particular weblog the ability to upload multiple pics that are restricted in file size to 100K and MP3s that are restricted to 500K? Sorry for the lack of understanding on this!

       
Mark Huot's avatar
Mark Huot
587 posts
17 years ago
Mark Huot's avatar Mark Huot

svh1 - You would set up two upload locations and assign each one to a different field. One location could have a max size of 500kb and the other 100kb.

       
rick.prince's avatar
rick.prince
111 posts
17 years ago
rick.prince's avatar rick.prince

I might be getting ahead of myself, but I changed line 832 from:

if(@copy($file_tmp_name, $server_path.$file_names[$file_key]) === FALSE)

to:

if(@move_uploaded_file($file_tmp_name, $server_path.$file_names[$file_key]) === FALSE)

No changes unfortunately.

       
Mark Huot's avatar
Mark Huot
587 posts
17 years ago
Mark Huot's avatar Mark Huot

rick.prince - Unfortunately that won’t work because I perform some modifications on the uploaded file before it’s copied. By doing so, PHP doesn’t think the file is a valid upload and therefore move_uploaded_file() doesn’t work. To fix this I’m going to move the copy/move_uploaded_file command higher up in the code and perform the checks on the copied file, not the raw upload.

       
First 18 19 20 21 22 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.